①给input控件 class="easyui-textbox"

<input class="easyui-textbox" data-options="required:true" type="text" ).textbox('setValue','小丑公司')//赋值

②给select 控件 下拉框赋值
<select data-options="required:true" >
$('#ShopType').combobox('setValue', 2);//赋值
var v = $('#ShopType').combobox('getValue');//取值 id

var text_v = $('#ShopType').combobox('getText');//取值text

③给input控件 class="easyui-numberbox"
<input class="easyui-numberbox" maxlength="20" />
$('#Age').numberbox('setValue', 206.12);//赋值
var v = $('#Age').numberbox('getValue');//取值

④给input控件 class="easyui-datebox"
<input type="text" name="date" ).datebox('setValue', '2014-9-12');//赋值
$('#date').datebox('getValue');//取值

⑤给input控件 class="easyui-numberspinner"
<input >
$('#ss').numberspinner('setValue', 8234725);//赋值
var v = $('#ss').numberspinner('getValue');//取值

⑥单选按钮Radio <td height="30" colspan="5">
<input type="radio" name="APPLYDEPTTYPE" value="事业法人" checked="checked" />事业法人
<input type="radio" name="APPLYDEPTTYPE" value="企业法人" />企业法人
<input type="radio" name="APPLYDEPTTYPE" value="社团法人" />社团法人
<input type="radio" name="APPLYDEPTTYPE" value="其他" />其他
</td>
//赋值
var str = result.APPLYDEPTTYPE;
$("[value='" + str + "']").attr("checked", true);
//取值
$('input[name="APPLYDEPTTYPE"]:checked').val()

⑦多选框checkbox
<td height="60" colspan="5">&nbsp
<input type="checkbox" name="BUSINESSSCOPE" value="水" />水 &nbsp&nbsp
<input type="checkbox" name="BUSINESSSCOPE" value="空气" />空气 &nbsp&nbsp
<input type="checkbox" name="BUSINESSSCOPE" value="土壤" />土壤</br>&nbsp
<input type="checkbox" name="BUSINESSSCOPE" value="噪声" />噪声 &nbsp
<input type="checkbox" name="BUSINESSSCOPE" value="生物" />生物
</td>
赋值:
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就是值

 

相关文章:

  • 2021-10-09
  • 2021-10-19
  • 2022-12-23
  • 2022-12-23
  • 2021-12-01
  • 2021-10-29
  • 2021-10-29
  • 2021-10-19
猜你喜欢
  • 2021-11-08
  • 2021-10-29
  • 2022-01-31
  • 2022-12-23
  • 2022-12-23
  • 2021-08-28
  • 2022-12-23
相关资源
相似解决方案