Form form
Usage
Copy Code code as follows:
<form id= "FF" method= "POST" >
...
</form>
Make the form an AJAX-submitted form.
Copy Code code as follows:
$ (' #ff '). Form ({
Url:...
Onsubmit:function () {
Do some checking.
Returns false to block commit
},
Success:function (data) {
Alert (data)
}
});
Submit Form
$ (' #ff '). Submit ();
To do a submit action.
Copy Code code as follows:
Call the form plug-in's ' submit ' method to submit form
$ (' #ff '). Form (' Submit ', {
Url:...
Onsubmit:function () {
Do some checking.
Returns false to block commit
},
Success:function (data) {
Alert (data)
}
});
Characteristics
null
name |
type |
description |
default |
url |
string |
form Submit Action URL . |
Event
Name |
Parameters |
Description |
onsubmit |
none |
Trigger before commit, return false to block commit action. |
success |
data |
triggered when the form is submitted successfully. |
onbeforeload |
param |
send request to load data Trigger. Return to false cancel this action. |
onloadsuccess |
data |
fires when form data is loaded. |
Onloaderror |
None |
Triggered when some error occurs while loading the form data. |
Method
Name |
Parameters |
Description |
Submit |
Options |
To do the submit action, the options parameter is an object that contains the series attributes: URL: URL of Action OnSubmit: callback function prior to commit Success: callback function after a successful commit |
load |
data |
Load records to populate the form. Data parameter can be a string or object type, string as a remote URL , otherwise as a local record. |
clear |
none |
clears form data. |
validate |
none |
for form field validation, when full Returns . This method and validatebox plug-ins are used together. |