This is a discussion on "Form validation" within the JavaScript Forum section. This forum, and the thread "Form validation are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
Form validation
|
||
| Notices |
![]() |
|
|
LinkBack (1) | Thread Tools |
|
|||
|
Form validation
I'm sure this is a total newbie question but I'm going to ask anyways because I haven't been able to find the answer anywhere else.
How can I check input in a form to see if it complies with a specific format? For example, if I want to make sure that they have input a valid email address, how do I check that it has an "@" and a ".", or for a phone number how can I check that they have input a number that is 10 digits long and no longer? and that it's actually numbers and not a sentence? Also, how can I set the size of the input boxes? I tried setting maxlength and different settings but nothing seemed to set it right. I feel like I should send the code, so I'm going to post the form... even though I'm pretty sure my question is pretty self explanatory without the code:
-Brittny Webmaster Theronyx.com[/code] |
|
|
|
|||
|
semi-solution
I've found part of my solution and thought i would post it here in case anyone else finds this sometime and they are looking for the answer too.
I found an advanced email check at http://www.javascriptkit.com/script/...2/acheck.shtml. I modified it to fit in with my solution. Here's my updated code (just the javascript since that's the only thing that's changed):
Thanks!! -Brittny Web developer at www.theronyx.com |
|
|||
|
solved!
Well, I feel really dumb that after posting my question I solved it myself...
But I figure I should at least post my solution so that anyone else with a similar question can find it... So what I ended up doing was breaking the phone number section down into three parts and then did a number check (another script that i found at www.javascriptkit.com) on each set of numbers. That way I avoided checking for characters to separate the digits and I could easily check for a phone number.
Thanks! -Brittny Webmaster at www.theronyx.com |
![]() |
| Tags |
| form, validation |
| Thread Tools | |
|
|
LinkBacks (?)
LinkBack to this Thread: http://www.webforumz.com/javascript-forum/2606-form-validation.htm
|
||||
| Posted By | For | Type | Date | |
| flash form validation | This thread | Refback | Sep 11th, 2006 07:15 | |
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Form validation help! | psycho wolvesbane | JavaScript Forum | 16 | Feb 12th, 2008 16:40 |
| Form Validation | cjrollo | Flash & Multimedia Forum | 0 | Feb 22nd, 2007 17:33 |
| Form Validation | feebee | JavaScript Forum | 1 | Aug 3rd, 2006 16:12 |
| PHP Form Validation. | kaz | PHP Forum | 2 | Jul 22nd, 2006 20:47 |
| PHP Form Validation ??? | j4mes_bond25 | PHP Forum | 2 | May 31st, 2006 23:08 |