如圖1所示,從留學國家中選中需要的留學國家,選中顧問觸發事件,獲取選中的留學國家,如果留學國家為空,提示留學國家不為空
圖1 前台頁面**如下
inputstudy.aspx
class="row"
id="panelabroad1"
runat="server">
class="span12">
class="input-group">
class="input-group-addon ie_widthauto">留學國家:
color="red">*font>
span>
id="ckkhopecountrylist"
cssclass="checkbox-inline form-control ie_widthauto checkboxlist "
runat="server"
repeatdirection="horizontal"
repeatcolumns="12">
asp:checkboxlist>
div>
div>
div>
class="row"
id="panelacouslt1"
runat="server">
class="span5">
class="input-group">
class="input-group-addon ie_widthauto">顧問:
color="red">*font>
span>
id="dllrecorddeplist"
name="dllrecorddeplist"
class="form-control ie_widthauto"
runat="server">
value="-1">無諮詢員option>
select>
type="hidden"
id="hidrecdep"
runat="server" />
type="hidden"
id="hidaconsultant"
runat="server" />
class="input-group-addon ie_widthauto">->span>
name="selaconsultant"
id="selaconsultant"
class="form-control ie_widthauto"
runat="server">
value="-1">--請選擇-- option>
select>
div>
div>
div>後台繫結checkboxlist資料,用的orm
inputstudy.aspx.cs
///
/// 留學國家
///private ilist gethopecountrylist(int groupid)
else
while (rdr.read())
return receplist;
}jquery**
consultanttype02.js
$(document).ready(function
() });
if (country == "" || country == undefined) else ,
success: function
(data)
else
}});
}});
});關鍵**為
var country = "";
$("input[name^='ckkhopecountrylist']").each(function
() });
jquery和js如何判斷checkbox是否選中
jquery input type checkbox attr value 返回結果 501 input type checkbox is checked 返回結果 選中 true,未選中 false js if document.getelementbyid checkboxid checked ...
CTreeCtrl 聯動選擇 checkbox
響應單擊tree控制項的事件 void cdlgtreetest onnmclicktreelayers nmhdr pnmhdr,lresult presult presult 0 設定checkbox的選擇狀態 void cdlgtreetest setitemcheckstate htreei...
GridView翻頁時保持CheckBox選擇狀態
是否翻頁 private bool changed false 定義儲存選擇項主鍵集合屬性 protected listselecteditems set 獲取選擇項主鍵 private void getselecteditem else 獲取選擇的記錄 for int i 0 i this.gve...