一、窗体对话框
13 1718
2、设置函数
1 function InitControl() { 2 $.get('../Source/maxbh.ashx', { "action": "maxbh", "tbName": "dwdoc", "fldName": "dwbh" }, function (result) { 3 var result = eval('(' + result + ')'); 4 if (result.success) { 5 var frm = $('#fm'); 6 var name = "dwbh"; 7 SetInputValue(frm, name, result.maxbh); 8 var names = "dwmch,beizhu"; 9 SetInputEmpty(frm, names);10 } else {11 AlterError("系统初始化失败!");12 }13 });14 }
1 function SetInputEmpty(frm, Names) { 2 var Arr = Names.split(","); 3 for (var i = 0; i < Arr.length; i++) { 4 var name = Arr[i]; 5 var txt = frm.find("input[name=\"" + name + "\"]"); 6 txt.val(""); 7 } 8 } 9 10 function SetInputValue(frm, Name, Value) {11 var txt = frm.find("input[name=\"" + Name + "\"]");12 txt.val(Value);13 //txt[0].value = vallue;14 }