I have a select field with some options in it. Now i need to find checked checkbox, and set my value in select option?
I have the following HTML:
<tr class="action_table_row">
<td><input type="checkbox" value="123"></td>
<td>XYZ</td>
<td>
<select class="delBoyChange">
<option value="14" selected>ABC</option>
<option value="15" >PQR</option>
<option value="16" >XYZ</option>
</select>
</td>
</tr>
I need to set the option with my value. How can this be done..?
here it's my jquery code
.done(function( msg ) {
if(msg.status == true){
$.each(msg.locationIds, function(value) {
var locId = value
checkbox = $(":checkbox[value="+locId+"]").attr("checked","true");
$(checkbox).find(".delBoyChange").val(msg.deliveryBoy);
});
}
Aucun commentaire:
Enregistrer un commentaire