This is a discussion on "[SOLVED] Field validation and changing display properties..." within the JavaScript Forum section. This forum, and the thread "[SOLVED] Field validation and changing display properties... are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
[SOLVED] Field validation and changing display properties...
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
[SOLVED] Field validation and changing display properties...
I have a somewhat complex form I am building for a site. I have broken this form down into a wizard based series of panels (divs) that display in succession as the user fills in the fields within them. This succession of panels is controlled by javascript. It shows and hides the panels on the fly as the user follows a series of proceed links through each step. The final step has the submit, completing the form.
What I would like to do is hide the proceed links by default for the required fields and only display the proceed link to the next step if the user has entered a value into that field. I am not sure the best way to go about this... Any ideas? |
|
|
|
||||
|
Re: Field validation and changing display properties...
You should be able to use onchange with a function that checks hides or displays the proceed like.
eg.
It will hide the link again if the try changing a field back to nothing. Hope that helps. Cheers,
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
|
|
|||
|
Re: Field validation and changing display properties...
Thanks Rakuli,
This works quite well. The only problem with it is that the link will not display until the user clicks an area outside the field. As some of the panels only contain 1 text field, its hard for the user to know what to do next once they have typed into the field without verbatim instruction. Is there any way to have the proceed link display as soon as the user begins typing, rather than having to click an area outside the field first? Its hard for me to explain it really. I have seen similar behaviour on some serial key input fields in software install wizards. Once you have typed the correct serial number, the 'next' link becomes active. I realise these were not simply done with javascript and I am not looking for validation to that degree. I only wish to have the link become active once the user has typed anything into the field, without having to click any area outside it... Does this make sense? |
|
||||
|
Re: Field validation and changing display properties...
Easy
Cheers
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
|
|
|||
|
Re: Field validation and changing display properties...
Fab! Exactly what I need!
Many Thanks... |
|
|||
|
Re: Field validation and changing display properties...
Actually, I had another question about this...
Since I have several panels with a 'proceed' link in them, I know I cannot use the same id value more than once in the markup in the single file. How do I specify more than 1? I have tried this:
|
|
||||
|
Re: Field validation and changing display properties...
the way I had it in my first post was so you could add all the id's you need to the tag itself
onkeyup="toggleProceed(new Array('id1', 'id2','id3' etc...))" It will loop through them all to make sure the values are set. You wouldn't have to change the function at all.
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
|
|
|||
|
Re: Field validation and changing display properties...
Yes that would work fine if I had all the fields in the form above one proceed link. However, because i'm dealing with several div panels within the form where each has its own field(s) and proceed link to another sucessive panel, specifying several id's in the first panel 'proceed' would not work as some of the id's it would be validating would be in panels which have not been accessed yet. It would simply leave the first proceed in a hidden state...
|
|
||||
|
Re: Field validation and changing display properties...
But only send the id's that would be required for that div.
Say the first div has 2 inputs that require data, for those two inputs only send those two id's. Then in the next div only put the required id's on the inputs in that one. You can put as many or as few as you like. It doesn't check all the id's all the time, just the one's you want for that input. Cheers,
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
|
|
|||
|
Re: Field validation and changing display properties...
Sorry if I am not understanding you correctly. To show you what is happening, go to: www.minutebox.com/post_request
step 1 and step 3 have this function applied yet step 3 does not work. Just proceed past step 2 as it is not finished. The source code will show that all the proceeds have the same id's which is one problem. I am aware of this bit. |
|
||||
|
Re: Field validation and changing display properties...
okay, sorry I understand now. I thought you would have just had one link that swapped the divs. I didn't realise you had a different link for each.
You could change the function like this
I hope that's what you mean. Cheers
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
|
|
|||
|
Re: Field validation and changing display properties...
You're a star! Works perfectly. Thanks for taking the time to help!
|
|
||||
|
Re: Field validation and changing display properties...
Cool
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
|
![]() |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [SOLVED] playing with Perl Compatible Regex in field validation | eon201 | JavaScript Forum | 33 | Oct 26th, 2007 15:07 |
| Non-text field Validation | NewDesigner | JavaScript Forum | 6 | Nov 24th, 2006 22:34 |
| Changing properties of hyperlinks? | tom_king88 | Web Page Design | 7 | Jul 7th, 2006 19:58 |
| Newbie: changing the value of a field on form | d9085 | Databases | 1 | Dec 12th, 2005 18:08 |
| Field Validation HELP! | Monie | JavaScript Forum | 5 | Nov 11th, 2004 19:46 |