javascript - Dynamically added radio button does not act like a different group -


i have following radio buttons

<input type="radio" class='form-control' name="progress_type[]" value="journal papers"><span class='radio-label'>journal paper</span> <input type="radio" class='form-control' name="progress_type[]" value="conference proceeding"><span class='radio-label'>conference proceeding</span> <input type="radio" class='form-control' name="progress_type[]" value="conference presentation"><span class='radio-label'>conference presentation</span> 

i want add block of radio group, same name value in php can array of selected values.

i adding next radio button group following jquery code

$(this).parent().prepend('<p class="help-block">type</p><input type="radio" class="form-control" name="progress_type[]" value="journal papers"><span class="radio-label">journal paper</span><input type="radio" class="form-control" name="progress_type[]" value="conference proceeding"><span class="radio-label">conference proceeding</span><input type="radio" class="form-control" name="progress_type[]" value="conference presentation"><span class="radio-label">conference presentation</span><p class="help-block">details</p><input type="text" class="form-control input-margin" name="progress_pub[]">'); 

it adds when test, can select 1 radio button out of 6. although thought can choose 2 different values 2 different radio button groups.

please note dont know how many radio button groups users create.

should use 2 dimensional arrays?

any help?

thanks

instead of using progress_type[] names radio buttons, use progress_type[id], replace id index of section of form.

then when you're processing parameters, can use $_post['progress_type'][$id] block's selection.


Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -