Networking | Hardware | Software | Multimedia | System | Unix&Linux | MBA

Home>>Hardware>>multiple onsubmit problem

multiple onsubmit problem

Kal
03-17-2006, 04:29 PM
hi,

i have two functions which do some validations on a form, i need to be able to execute these when the submit button is pressed. i can only get one to execute not the other.

can anyone help please.

thanks in advance

Beagle
03-17-2006, 04:35 PM
function mainOnSubmit()
{
return subOnSubmit1() && subOnSubmit2();
}

<form onsubmit="return mainOnSubmit();">

Kal
03-17-2006, 04:46 PM
probably me, but that doesnt seem to work, i have the following functions, and onSubmit:-

<SCRIPT LANGUAGE="JavaScript">

function Length_TextField_Validator()
{
if ((changepasswordform.customers_password_1.value.length < 6) || (changepasswordform.customers_password_1.value.length > 10))
{
mesg = "You have entered " + changepasswordform.customers_password_1.value.length + " character(s)\n"
mesg = mesg + "Valid entries are between 6 and 10 characters.\n"
mesg = mesg + "Please verify your input and submit again."
alert(mesg);
changepasswordform.customers_password_1.focus();
return (false);
}
return (true);
}

function checkPw(changepasswordform)

{
customers_password_1 = changepasswordform.customers_password_1.value;
customers_password = changepasswordform.customers_password.value;

if (customers_password_1 != customers_password) {
alert ("\nYou did not enter the same new password twice. Please re-enter your password.")
return false;
}
else return true;
}

</script>

<FORM NAME="changepasswordform" ACTION="change_password_2.php" METHOD=GET onSubmit="return checkPw(this);">

Kal
03-17-2006, 04:51 PM
sorry my mistake i got it to work, thanks for your help.


 

TOP

Hyperthreading hurts s
HP sharpens blade PC l
Apple goes for Quad po
Itanium gets scaled do

For more info

HP sharpens blade PC l
Hyperthreading hurts s
can not call click() i
script does not work o
smart menu 
write to an html file 
FireFox doesn't recogn
Changing e.keyCode (e.
Clearing a range creat
UPDATE: My mouse over 

News Archive

onChange Help 
beforeload? vs onload.
Problem with document.
decreasing my javascri
Problem with \\ and \ 
how to stop scrolling?
Change Label Text Colo
Can I forward a page b
2 javascript functions
Validating a textbox 

Related stories:

onload for images that are dynamically generated -- a problem in IE
Simple mathematicall formula???
table row display problem
stop form action from opening window
Strange Behaviour
moving the browser window
Quotes in a string
Copy link text to clipboard
Problem with htmlarea

Copyright@2004-2005 www.zzcoke.com All Right Reserved

advanced web statistics