|
|
Forum moderator: bigblog |
uCoz Community For Webmasters Custom Solutions Email form numeric Validation (Email form Specific numeric range Validation) |
Email form numeric Validation |
Email form Specific numeric Validation
Just hoping you can give me some pointers/help on validating email form inputs. I'm guessing i need to use javascript (although the possibility seems to be available in html5), but havent got much experience of javascript. I need to validate that a specific text field when entered is numeric between a certain range. Added OK i have got so far by myself but just have one issue left. I have added the script to the form template:- <script language="JavaScript1.2"> function checkreference(){ var regexp=/^([0-9]{6})$/ //regular expression if (document.mform.f8.value.search(regexp)==-1) //if match failed alert("Invalid Welcome Pack Reference") } The relevant field is :- <tr><td>Welcome Pack Reference<font color="red">*</font>:</td><td><input type="text" name="f8" size="30" style="width:95%;" maxlength="6"> </td></tr> The button has been changed to call the script onclick :- <tr><td colspan="2" align="center"><br /><input type="submit" onClick="checkreference()" value="Submit Activation"></td></tr> My problem is that when an invalid entry is made , the message is displayed but the email is still sent. Please advise Added (2013-02-04, 6:31 PM) Added (2013-02-15, 7:32 AM) Some of my Websites:-
www.UltimateSolutionsandServices.co.uk www.LawrenceHillBlog.co.uk www.UltimateTravelServices.co.uk www.UltimateTravelBlog.co.uk Post edited by Loz - Saturday, 2013-02-02, 8:36 AM
|
| |||
| |||