I hope this is the right place for this question, I'm working on a site with HTML/CSS/PHP/AJAX and i have a form that i don't want the submit button to be 'enabled' or clickable until all the other fields in the form are filled??
Form Submit Button Unclickable Until All Fields Are Filled In??
Collapse
X
-
-
I have this so far:
Can you point me in the right direction?Code:<script language="javascript"> function checkfields() { } </script> </head> <body> <form method="post" method="../signup/"> <input type="text" id="uname" name="uname" size="35" /> <select id="day" name="day"> <option value="0">dd</option> </select> / <select id="month" name="month"> <option value="0">mm</option> </select> / <select id="year" name="year"> <option value="0">yyyy</option> </select> <input type="radio" id="gender" name="gender" value="male"> male$nbsp;<input type="radio" name="gender" value="female"> female <input type="submit" value="signup" onclick="checkfields(); return false;" /> </form>Comment
-
So what did you use in the end?
If you had the submit button disabled, you could enable it when all fields are filled in by calling a function onblur of each element. Another option is to call the form submit() method. I would suggest that you disable the submit button onload via JavaScript so that users with JavaScript disabled will still be able to submit.Comment
Comment