I have two forms on one page. I want the 2nd form to call the validate function and check an input field in the 1st form and then if all goes well, submit the 2nd form. I’m having problems though. Here is the 2nd form
[code=html]<form id=”form_finish” name=”form_finish” method=”post” action=”order3.php” onSubmit=”return validate(this);”>
<a href=”javascript:validate(document.forms.form_finish);”><img src=”/images/orange_button_checkout.png” alt=”Check Out” border=”0″></a>
<input type=”image” src=”/images/orange_button_empty.png” name=”clear” value=”Empty Cart” />
</form>
…and here is my validate function which is in the <head> tags…
[CODE]function validate(form)
{
val = document.getElementsByName(“form_phrase”)[0].value
if(val == “” || val == null)
{
form.submit()
}
else
{
var name = confirm(“You have entered information for another band, but have not updated the cart. Would you like to continue anyway?”)
if(name==true)
{
form.submit()
}
}
}
I get this error…
“form has no properties”
Any help would be greatly appreciated ?