var form = liger.get("form1")
var data = form.getData()
alert(liger.toJSON(data))
设置表单数据:
var form = liger.get("form1")
form.setData({
Title: '标题1111',
addDate: new Date(),
Country : 'ZG'
})
ashx 应该写成和form 表单中元素name对应的各个参数,类似
public string Receive(string Title, DateTime addDate, string Country)
{
}
前台提交表单可以用jquery.form.js 这个插件,ajax 异步提交表单
https://github.com/malsup/form/archive/master.zip
jquery.form 使用例子:
$('#form_wirteLog').ajaxSubmit({
url: "aa.ashx",
dataType: 'json',
success: function (data) {
if (data != null &&data.Status == 0) {
showmsg(CommonMsg.Sccuess)
if ($("#form_wirteLog [name=ID]").val() == "") {
}
} else {
showmsg(data.Message, 1)
}
},
error: function (xhr, status, error) {
}
})
$("#form2").ligerForm({inputWidth: 200, labelWidth: 300, space: 40, rightToken:"",
fields: [
{ name: "ProductID", type: "hidden" },
{ display: "hardware vendor", name: "PreferredVendor", id: "PreferredVendor", newline: true,comboboxName: "PreferredVendor", type: "select",options: { data: [{ id: 1, text: 'asdf' },{ id: 2, text: 'jkl'}] },validate:{required:true } }
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)