I want to use javscript to verify that certain form fields have been filled in instead of php that's currently being used to speed things up a little and lighten the load on the server. I can check one input, but I don't know how to do multiple ones.
Here's what I have (with "onSubmit="return verify()"" in the form tag):
Code:
<SCRIPT LANGUAGE=JAVASCRIPT>
function verify(){
if(document.forms[0].name_first.value==""){
alert("Enter a first name");
return false;
}else{
return true;
}
</script>
How can I make this function verify more inputs? Thanks.
|