July 30th, 2003, 11: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, 12:27 PM
Hope that helps.
July 30th, 2003, 12:51 PM
Hm. That works.
Most of the java tutorials on form validation used the IsEmpty() function. Oh well.
July 30th, 2003, 12:53 PM
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, 12:57 PM