Free web development scripts for the webmasterDevelopment Scripts


 
 Site Navigation
 o Development Scripts
 o Text Only Edition
 o PHP.net News
 o Tutorials
 o Register an account
 o New entries this week
 o Affiliates/Links
 o Contact Us
 o About us
 o Advanced Search

 Browse Path

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /usr/local/psa/home/vhosts/devscripts.net/httpdocs/online.php on line 28
 o  users online
 o Most users online: 67
 o Home
  o Javascripts
   o Forms Manipulation
    o Script

 Member Login
User Name
Password

 Standards
Valid XHTML 1.0!
Valid 
CSS!

 Recommended Links
 o PHP Freaks
 o Designer Baby Clothes
 o Advertise Here Make Money
 o Free Online Invoices
 o Wedding Vendor Directory
 o UK Business Franchises
 o designplace
 o Free Wedding Websites
 o OxyScripts
 o Send Invoices for Free

Compare two (2) form values and see if they're the same (Rated 0)

Description:

In this example it simply displays an alert, whereas in reality you'd want to only display to the alert if there is an error.

Code starts here


<script>
function compare(valOne, valTwo)
{
if (valOne != valTwo)
{
alert("Your passwords must match");
return false;
}
else
{
alert("Your passwords match - well done");
return false;
/*Comment out the two line above and uncomment the one below to actually submit the form*/
//return true;
}
</script>

<form action="page2.html" name="myForm">
<input type="text" name="passwordOne"><br><br>
<input type="text" name="passwordTwo"><br><br>
<input type="submit" onClick="JavaScript: return compare(myForm.passwordOne.value,myForm.passwordTwo.value); return false;">
</form>


Submitted by MattK on 06-01-2006 8:39


Rate This Script

User Contributed Comments

On 06-08-2010 12:50 said:

v3bChn ymioxhqfbgrk, [url=http://ipoqxqzmhdxu.com/]ipoqxqzmhdxu[/url], [link=http://skifstfihikt.com/]skifstfihikt[/link], http://soiukrukwqhd.com/


On 11-08-2010 21:07 said:

onBNS3 mngoacmrpbwk, [url=http://qpxqktbtvqpq.com/]qpxqktbtvqpq[/url], [link=http://zptajncnxjqz.com/]zptajncnxjqz[/link], http://mwfeoonnbovo.com/


Registered Members login
© Copyright 2003 - Devscripts.net