Links

Lists

Latest Updates

Ruby On Rails List
Python list
Advanced Java
The JavaScript List
Apache Users
Full Disclosure
Linux Security

Search the archives!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Javascript] Newbie question


  • From: rer at datacompusa.com (Roger Roelofs)
  • Subject: [Javascript] Newbie question
  • Date: Thu Dec 1 12:57:25 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@xxxxxxxxxxxxxxx
3215 Eaglecrest Drive, NE
Grand Rapids, MI  49525-4593