JQuery to show/hide elements and toggle between them.

| November 6, 2009 | Reply

I have a form with a radio button on it to select from two different sets of options.
Each radio button should dynamically load the correct set of options into a select box. Since one select box is filled with static options, and the other is filled with database records, using AJAX to dynamically populate the select box based on the selected radio button didn’t seem like the right thing to do.

Instead, I loaded both select boxes, and used JQuery to toggle which one is visible, based on the selected radio button.

Select List Type : System List
User Defined List Group :
< ?php echo form_dropdown('usergroups',$field_usergroups); ?>
< ?php echo form_dropdown('systemgroups',$field_systemgroups);?>

Tags: ,

Category: Uncategorized

About the Author ()