我想分開幾個部分,每個輸入都具有相同的名稱屬性。PHP多組單選按鈕碰撞
<div class="section">
<h4>Radio-option</h4>
<input type="radio" name="radio_array[]" value="yes" />Yes
<input type="radio" name="radio_array[]" value="no" />no
</div>
<div class="section">
<h4>Radio-option</h4>
<input type="radio" name="radio_array[]" value="yes" />Yes
<input type="radio" name="radio_array[]" value="no" />no
</div>
<input type="button" onclick="functionToAddAnotherSection()" value="Add Section" />
這些div部分可以添加,重複甚至排序(jQuery可排序)。我沒有這些部分的任何ID鍵,它們都被嵌入到一個數組中,當它們再次顯示時,我只需打破數組並將每個值放入每個部分。
我不確定你的問題是什麼 – WillardSolutions
而......你的問題是什麼? – Pipe
您應該至少分配一個ID或某物以將屬性賦予任何部分。否則,您應如何收集任何信息? – briosheje