How to create Dynamic Radio Button in Ajax
1 posts in topic
Flat View  Flat View

Posted By:   kossy_Anaekwe
Posted On:   Tuesday, December 26, 2006 12:48 PM

I need help, I am building a form and I want to apply a mouse on click event action for a radio button.
This is what I inted to achieve.

When chioce 1(yes) is selected in the radio group. A text field appears
which has the auto-suggest effect that s user type in to this text
matching entries will be displayed

Also When Radio chioce 2(no) is selected a manue select field appear
for user to selesty any of the listed value.

How can I do this using ajax.
I am a complet newbie in Ajax,

Re: How to create Dynamic Radio Button in Ajax

Posted By:   Anonymous  
Posted On:   Sunday, December 31, 2006 03:03 PM

For simple matters of radio buttons, it's best to use javascript to hide/show elements without a trip back to the server. But for making suggestions that require queries to a database, for instance, here is a general idea of how to solve the problem:

HTML javascript server page
| | |
1. control changed --> | |
| | |
| 2. send request --> |
| | 3. process request
| | <-- send response
| | |
| 4. handle req state change |
| <-- update html control |
| | |
change appears to user | |
| | |

0. Include the following general-purpose script.
(It could be maintained as a separate file and included as follows: