|
Simple solution - use named functions.
To invoke more than function:
onsubmit="ValidateForm(); ValidateAccount();"
Form validation of the pattern if(document.getElementById("reqAddrName").value == ""){ is barely worthy of the name, and virtually useless, as even a single space, an X or a ? will return false, that is pass the validation. Numeric values, such as zip codes and phone numbers, should be validated as such. Ditto email addresses. This topic has been covered many times before in this forum.
Finally, if form elements are to be submitted to a server, they must be given names (not just ids). In fact there is not a lot of point in assigning ids to form elements.
All advice is supplied packaged by intellectual weight, and not by volume. Contents may settle slightly in transit.
__________________
All the code given in this post has been tested and is intended to address the question asked.
Unless stated otherwise it is not just a demonstration.
Last edited by Philip M; 02-24-2012 at 04:42 PM..
|