July 30th, 2003, 10:58 AM
Here's my experimental code:
When I click submit, it goes on to the test.php page, even when the fname field is blank. What am I missing?
alert('You have not entered a first name')
<form name=form action=test.php method=post onsubmit="return ValidateForm(this);">
<input type=text size=10 name=fname>
<input type="submit" name="submit" value="Submit">
July 30th, 2003, 11:27 AM
Hope that helps.
July 30th, 2003, 11:51 AM
Hm. That works.
Most of the java tutorials on form validation used the IsEmpty() function. Oh well.
July 30th, 2003, 11:53 AM
Well... if you do use isEmpty(), notice the non-capitalized i ... Most programming languages (JS, PHP, etc) make predefined functions start with a lower-case letter as far as I know.
July 30th, 2003, 11:57 AM