jQuery-easyui表单控件取值、赋值

(1)easyui-validatebox
   赋值:$("#...").val("12121");
   取值:$("#...").val();

(2)easyui-combobox
   赋值:$("#...").combobox("getValues");
   取值:$("#...").combobox('setValue','hahah');

(3)easyui-numberbox
   赋值:$("#...").numberbox('setValue',206.12);
   取值:$("#...").numberbox('getValue');

(4)easyui-datebox
   赋值:$("#...").datebox('setValue','2014-9-12');
   取值:$("#...").datebox('getValue');

(5)单选按钮radio
   取值:$('input[name=""]:checked').val();

(6)多选框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(){
          isc += $(this).val() + ",";
        });
        if (isc.length > 0){
          isc = isc.substring(0, isc.length - 1);
}

你可能感兴趣的:(jquery)