View Single Post
Old 10-07-2012, 10:44 AM   PM User | #5
Philip M
Supreme Master coder!

 
Philip M's Avatar
 
Join Date: Jun 2002
Location: London, England
Posts: 17,103
Thanks: 197
Thanked 2,421 Times in 2,399 Posts
Philip M has a spectacular aura aboutPhilip M has a spectacular aura aboutPhilip M has a spectacular aura about
Quote:
Originally Posted by Giantg52 View Post
@Phillip M, that simply didn't work. Not sure if I was supposed to add anything, I tried messing with it a little bit but didn't get it to work.
Wel, it works for me Perhaps the problem is that you have two opening braces { one (correctly) on the same line and another one (permissible but less good practice) on the following line.

xelawho told you to assign an id (as well as a name) to each element (form field) - you have not done that.

e.g.
First Name: <input type="text" name="fname" id = "fname" value="" size="20" /><br />

But both of us have pointed out the inadequacy of this simple "validation".

and then address it with

if (document.getElementById("fname").value=="") { // place opening brace on the same line, not the folowing line


But both of us have pointed out the serious inadequacy of this simple "validation".
__________________

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; 10-07-2012 at 10:47 AM..
Philip M is offline   Reply With Quote
Users who have thanked Philip M for this post:
Giantg52 (10-07-2012)