jquery遍历select
js:
${BindComplaintType}
${BindReReason}
function select(sltName,value){
$("select[@name="+sltName+"] option").each(function(){
if($(this).val() == value){
$(this).attr("selected","selected");
}
});
}
后台.cs
string strJS = "select('select','" + h["ComplaintType"].ToString() + "');";
mVh.Put("BindComplaintType", strJS);
string strJS1 = "select('select2','" + h["ReReason"].ToString() + "');";
mVh.Put("BindReReason", strJS1);//Return Reason
${BindComplaintType}
${BindReReason}
function select(sltName,value){
$("select[@name="+sltName+"] option").each(function(){
if($(this).val() == value){
$(this).attr("selected","selected");
}
});
}
后台.cs
string strJS = "select('select','" + h["ComplaintType"].ToString() + "');";
mVh.Put("BindComplaintType", strJS);
string strJS1 = "select('select2','" + h["ReReason"].ToString() + "');";
mVh.Put("BindReReason", strJS1);//Return Reason