[Javascript] Newbie question

Roger Roelofs rer at datacompusa.com
Thu Dec 1 12:56:43 CST 2005


Schalk,

On Dec 1, 2005, at 1:39 PM, Schalk wrote:

> Thanks Peter, that will help but, maybe I should rephrase my  
> question. I have a form and at the end I give the user between 2 -  
> 3 payment options. When they click on one of these (radio buttons)  
> the appropriate form fields should show below these radio buttons.
>
> If for example the user chooses credit card, onlt fields relevant  
> to a credit card should show and all others hidden and so forth.  
> Thanks!

If the fields you want to show/hide are in fieldsets, all you have to  
do is set the className of the fieldsets after you know which radio  
button they clicked.  In fact, you probably want to show all  
fieldsets and hide them on page load in the same manner.  That way,  
if the user has javascript turned off they can still use the form.

If you need sample code, I can put something together after work.

Roger
-------------------------------------------------------
Roger Roelofs                          web   www.datacompusa.com
Datacomp Appraisal Services   Email rer at datacompusa.com
3215 Eaglecrest Drive, NE
Grand Rapids, MI  49525-4593





More information about the Javascript mailing list