greyed out form inputs?

liunx

Guest
I would like to set up a form such that the user must fill in one field (ie: name) before he can fill in other fields (ie: address, zip code). However, the user must be able to see the address and zip input fields at all times. Further, there must be some visual cue that the input fields are unavailable while name is empty.<br />
<br />
Is there some way to grey-out or ghost input elements? How would you do this?<!--content-->Add disabled="disabled" to the form elements to disable them... You'll need some JavaScript (and a bit of creativity to keep it working for non-JS users) to make enable the next field, once they fill out the pervious...<!--content-->mmm disabled="disabled" looks kind of weird<!--content-->But with XHTML we must not have empty attributes (a requirement that I carry over to HTML 4.01): <!-- m --><a class="postlink" href="http://www.w3.org/TR/xhtml1/#h-4.5">http://www.w3.org/TR/xhtml1/#h-4.5</a><!-- m --><!--content-->How do you plan to service the people who might browse your website with javascript turned off?<br />
<br />
What advantage does this (disabling/enabling fields) give you or the user? Not all users fill out their details in the same order as you do. For example, when I fill out a form, I start with the textbox that is nearest to my mouse (if no textbox is focused currently), just because it is faster for me.<br />
<br />
There are some valid reasons to show or hide form elements (using javascript or otherwise)... but your example doesn't seem to be one of them.<!--content-->
 
Back
Top