- 时间 2014-09-16 10:57:35 博客园-所有随笔区 原文 http://www.cnblogs.com/szxlh/p/3973273.html 1.Input a. validatebox 定义: 赋值: $("#APPLYDEPTNAME").val('1212'), 取值: $("#APPLYDEPTNAME").val() b. ComboBox 定义: 城市: 区县: 街道: 取值: $("#city2").combobox("getValues") $("#city").combobox("getValues") + "," + $("#area").combobox("getValues") + "," + $("#SC001_APPLYDEPTADDRESS").val(), 赋值: $('#city').combobox('setValue', ‘北京’); 回显: //公司地址 var str4 = result.APPLYDEPTADDRESS; if (str4 != null) { var strs4 = new Array(); strs4 = str4.split(","); $('#city').combobox('setValue', strs4[0]); var url = '../../Ajax/InforService.ashx?Method=GetArea&CityAreaCode=' + strs4[0]; $('#area').combobox('reload', url); $('#area').combobox('setValue', strs4[1]); $("#APPLYDEPTADDRESS").val(strs4[2]); } c. NumberBox 定义: 赋值: $('#nn').numberbox('setValue', 206.12); 取值: var v = $('#nn').numberbox('getValue'); d.DateBox 定义: 赋值: $("#SC001_CERTIFICATEVALID").datebox('setValue', '2014-9-12'); 取值: $('#nn').datebox('getValue'), e.NumberSpinner 定义: 赋值: $('#ss').numberspinner('setValue', 8234725); 取值: var v = $('#ss').numberspinner('getValue'); 另附 单选按钮Radio 定义 事业法人 企业法人 社团法人 其他 赋值: var str = result.APPLYDEPTTYPE; $("[value='" + str + "']").attr("checked", true); 取值: $('input[name="APPLYDEPTTYPE"]:checked').val() 另附 多选框checkbox 定义:   水     空气     土壤
  噪声   生物 赋值: var str3 = result.BUSINESSSCOPE; if (str3 != null) { var strs = new Array(); strs = str3.split(","); for (i = 0; i < strs.length; i++) { $("[value='" + strs[i] + "']").attr("checked", true) }; } 取值: var isc = ""; $("input[name='BUSINESSSCOPE']:checked").each(function () { //遍历table里的全部checkbox isc += $(this).val() + ","; //获取被选中的值 }); if (isc.length > 0) //如果获取到 isc = isc.substring(0, isc.length - 1); //把最后一个逗号去掉 string isc就是值 2.TextArea 定义: 赋值和取值与Input标签相同。