In javascript, I am trying to call more than one function starting with onclick in a form.
In the form, this does not work:
So I tried only function_1 for the onclick, and put this in the .js file, but it also does not work:
In both cases, the first function works, but not the second, and the Firefox Error Console does not return an error.
How do I call function_2?
In the form, this does not work:
Code:
<input type="submit" value="thevalue" name="goodname" onclick="return function_1(this.form);function_2(this.form);" />
So I tried only function_1 for the onclick, and put this in the .js file, but it also does not work:
Code:
function function_1(health)
{
if(health.phone.value=="")
{
alert("Please enter your home telephone number.\n");
return false;
function_2();
}
return true;
}
function function_2(health)
{
if(health.first_name.value.length<2)
{
alert("Please enter your first name.\n");
return false;
}
return true;
}
How do I call function_2?