Welcome to WebmasterWorld Guest from 54.226.238.178

Forum Moderators: open

Message Too Old, No Replies

Help with a validation function?

     
10:23 pm on Mar 15, 2008 (gmt 0)

Junior Member

10+ Year Member

joined:May 8, 2006
posts:43
votes: 0


Keeps failing - any suggestions?


function checkpass(field1,field2,alerttxt)
{
with (field1,field2)
{
if (Pass1.value != Pass2.value)
{alert(alerttxt);return false}
else {return true}
}
}

function validate_form(thisform)
{
with (thisform)
{

if (checkpass(Pass1,Pass2,"Passwords do not match!")==false)
{Pass1.focus();return false}
}
}

1:03 am on Mar 16, 2008 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Nov 3, 2005
posts:1585
votes: 0


function checkpass(Pass1,Pass2,alerttxt)
{
if (Pass1.value != Pass2.value)
{alert(alerttxt);return false}
else {return true}
}

Perhaps ?

In any case do away with the "with" statement

 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members