Copy Code code as follows:
The fill of the Drop-down list
_showschools:function {//data represents a data object
var myselect = document.getElementById ("Selectschools"); Get Drop-down Box
mySelect.options.length = 0;
Add option to the SELECT tag
For (var index in data) {
var item = Data[index];
var opp = new Option (item. Schoolname, Item.name); The first argument represents what is displayed in the Drop-down box, and the second represents what is selected by the Drop-down box
opp.name = "option" + index;
Myselect.add (OPP);
}
},
Access to Drop-down list content
var SchoolID = document.getElementById ("Selectschools"). Value;
We usually select the value of the Drop-down box is selected, rather than the display of content, how to get the displayed content, the following is to get the dropdown box of the selected display content
function On_idmbzd_change () {
var Sel_obj=document.getelementbyid ("Idmbzd");
var Index=sel_obj.selectedindex;
alert (Sel_obj.options[index].value);
alert (Sel_obj.options[index].text);
}
//access to the contents of the radio button
var chkobjs = Document.getelementsbyname ("Radio");
var checkvalue = null;
for (var i = 0; i < Chkobjs.length; i++) {
if (chkobjs[i].checked) {
CheckValue = parseint (Chkobjs[i]. Value);
}
}
//radio button Settings
if (entity. SelectType = = 1) document.getElementById ("SelectType"). Checked = true;
if (entity. SelectType = = 0) document.getElementById ("Unselecttype"). Checked = true;
Settings for multiple-selection boxes
Setcheckbox:function (data) {
var courselist = document.getelementsbyname ("Courselist");
for (var i = 0; i < courselist.length-1; i++) {
if (courselist[i].value==data) {
Courselist[i].checked=true;
}
}
},