Home > Web Front-end > JS Tutorial > body text

Example sharing of form submission in EasyUI_jquery

WBOY
Release: 2016-05-16 16:11:49
Original
943 people have browsed it

Copy code The code is as follows:

$('#form').form({
url: 'test/add.do',
onSubmit : function() {
parent.$.messager.progress({
Title: 'Tips',
Text: 'Data processing, please wait....'
});
var gridValid = endEdit();//Sub table exits editing verification
if (!gridValid) {
parent.$.messager.progress('close');
Return false;
}
var isValid = $('#form').form('validate');
if (!isValid) {
parent.$.messager.progress('close');
Return false;
}
// Write the added, modified, and deleted data in the subtable to the hidden input
accept();
Return true;
},
success : function(result) {
parent.$.messager.progress('close');
Try {
Data = eval("(" result ")");// Convert JSON string into object
If (data && data.success) {
If (data.msg && data.msg != "")
       parent.$.messager.alert('prompt', data.msg);
      else
       parent.$.messager.alert('prompt', "Added successfully");
Parent.$.modalDialog.openner_grid.datagrid('reload');// Refresh Gird data
​ parent.$.modalDialog.handler.dialog('close');//Close the current modal window
} else
Parent.$.messager.alert('error', data.msg); // Operation failed
} catch (e) {
Parent.$.errorDialog(result);// Prompt server exception
}
}
});

The above is the entire content of this article, I hope it can be helpful to everyone.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!