1//get a class based on grade
2
3function Btngetbj (NJM,BH) {
4$.ajax ({
5Cachefalse,
6Type"GET",
7Url:'tpjg.ashx? Handlertype=getbj&njm='+ NJM +'&xqh='+ $('#seletXQ
8
9option:selected'). Val (),
TenDataType:'JSON',
OneSuccess:function (JSON) {
A//Ajax Load Select
-if(JSON! =""|| JSON! =NULL|| JSON! = undefined) {
-document.getElementById ("SELETBJ"). InnerHTML ="";
thedocument.getElementById ('SELETBJ'). Add (NewOption ("---",""));
- for(vari =0; i < json.length; i++) {
-document.getElementById ('SELETBJ'). Add (NewOption (Json[i].texts, JSON
-
+[I].values)];
-}
+//Set Selected Items
Aif(BH! ="") {
atvarAll_options = document.getElementById ("SELETBJ"). Options;
- for(varj =0; J < All_options.length; J + +) {
-if(All_options[j].value = = BH) {
-all_options[j].selected =true;
-}
-}
in}
-}
to}
+});
-}
the //load selection of Select when page is initialized
*$ (function () {
$BTNGETBJ ('<%= NJM%>','<%= BH%>');
Panax Notoginseng})
-
the
+
A
the
+//background Binding Select, setting Selection
-
$<option value="">---</option>
$<%foreach(varDicinchXqlist)
-{%><option value="<%= DiC. XQH%>"<%= request.querystring["SELETXQ"] ==
-
theDic. Xqh?"selected":""%>>
-<%= DiC. Xqmc%></option>
Wuyi<%}%>
the</Select>
Ajax and select, binding values, dynamically loading the item value of Select, setting the selected value (all client controls)