The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> how to create new form elements based on radio button selection?
goatberg
post Aug 12 2010, 10:57 AM
Post #1


Newbie
*

Group: Members
Posts: 10
Joined: 31-May 07
Member No.: 2,956



I have a form. In this form I have a radio button with a yes/no selection. If the radio button is selected yes then I would like a new section of the form to popup which would have three additional questions each with their own radio button.

If no is selected on that first radio button then I would like for no additional section to popup within the form.

Any ideas?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Aug 12 2010, 11:09 AM
Post #2


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,716
Joined: 9-August 06
Member No.: 6



Google "dynamic forms" and you should find a lot.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Aug 12 2010, 04:55 PM
Post #3


.
********

Group: WDG Moderators
Posts: 9,630
Joined: 10-August 06
Member No.: 7



Create all the form elements with HTML, and use javascript to hide the second set initially. This way it can be made to work even if JS is not used (unlike solutions where the second set is created by JS), but you must always double-check the replies in the server-side script the form is submitted to.

But the most reliable way should be to let the first question's form submit to a new form with the second set of questions.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 29th March 2024 - 05:49 AM