This is a discussion on "help with validation" within the JavaScript Forum section. This forum, and the thread "help with validation are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
help with validation
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
help with validation
Hi there!
basically i have built a form and validated the input using regular expressions. When the user enters an invalid entry (onChange) an alert box pops. This works fine. However alert boxes can create problems for visually impaired users who use screen magnification. So what i am trying to do is create an additional error msg at the side of the input box. similar to the example shown here: http://www.xs4all.nl/~sbpoley/webmatters/formval.html I attempted many ways of doing this and i cannot seem to get it to work. I have run the code through a javascript varifier so there should not be a typing/spelling errors. Here is the function:-
Thanks! Last edited by karinne; Jul 26th, 2007 at 15:00. Reason: Please use [ code ]...[ /code ] tags when displaying code! |
|
|
|
#2
|
|||
|
|||
|
Re: help with validation
well the other alternative is to place a blank DIV placeholder next to the fields, then when you use the alert box just do an
document.getElementById("divid").innerHTML = "Error message here"; there we go. |
|
#3
|
||||
|
||||
|
Re: help with validation
I would say that innerHTML is the way to go.
For streamlining your code (for validation and Search engines) to avoid blank elements, you could pick upon the field itself and use various methods to add a child or sibling element to target innerHTML. Something to think about anyway!
__________________
Click the 'Thanks!' button if this post has helped you Rob - Webforumz Founder
Last Blog Entry: Creative Labs threaten developer over home made drivers.... (Apr 1st, 2008)
|
![]() |
| Tags |
| form validation, getelementbyid, nextsibling, nodevalue |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Help with validation | snappy | Web Page Design | 4 | Mar 27th, 2008 18:33 |
| w3c validation | cocoonfx | Web Page Design | 8 | Jul 21st, 2007 13:55 |
| CSS validation | VanessaJW | Web Page Design | 17 | May 24th, 2007 19:59 |
| CSE for validation | nextgen | Scripts and Online Services | 3 | Jan 30th, 2007 03:41 |
| Validation help | Powderhound | Web Page Design | 13 | Nov 4th, 2006 20:53 |