0
中设置数组到dyanamic下拉列表这是在用户点击[添加更多]按钮之后新行添加的图片。它工作正常,但我想使用ajax发送这些值。我可以访问所有带有数组映射函数的textbox值都在ajax中,除了下拉值。
我们可以在php
我将如何用这个例子来实现它。谢谢!
<tr>
<td><input type='checkbox' class='case'/></td>
<td>1.</td>
<td> <select name='relation[]' id='relation' >
<option value='brother'>Brother</option>
<option value='sister'>Sister</option>
</select>
</td>
<td><input type='text' id='name' name='name[]'></td>
<td><input type='text' id='school' name='school[]'></td>
<td<select name='medium[]' id='medium'>
<option value='marathi'>marathi</option>
<option value='english'>english </option>
</select>
</td>
<td> <?php
//Get all class data
$query = $db->query("SELECT * FROM `class_master`");
//Count total number of rows
$rowCount = $query->num_rows;
?>
<select name="std[]" id="std" class="form-control focusedInput" >
<option value="">Select Standard </option>
<?php
if($rowCount > 0){
while($row72 = $query->fetch_assoc()){
echo '<option value="'.$row72['class_id'].'">'.$row72['class_name'].'</option>';
}
} else {
echo '<option value="">Class not available</option>';
}
?>
</select>
在页面和的起始
你的代码是否适用于动态值,如果是,那么当你想调用ajax时,我的意思是在哪个事件? –
按钮单击事件我已发送所有值 –