Constructor
new AjaxSubmit()
Properties:
Name | Type | Description |
---|---|---|
request-timeout |
number | number of ms that the entire operation is expected to complete within. Default is 5000 |
submitted-lifetime |
number | number of ms that "submitted" should remain on the element after the form has completed. Default is 2000 |
requesting |
boolean | boolean attribute that indicates the request has been made, but not yet returned. Don't set this yourself outside of development. It will be set and removed by this element. |
submitted |
boolean | boolean attribute that indicates the form has been successfully submitted. Don't set this yourselr outside of develoment. It will be set and removed by this element. |
log-request-errors |
boolean | if set, logging related to request error handling will appear in the console. It will also cause any form submission to be delayed by 2s to allow you to read the console. |
- Source:
Fires:
- brut:submitok Fired when the AJAX request initated by this returns OK and all processing has completed
- brut:submitinvalid Fired when the AJAX request initated by this returns a 422 and all logic around managing the reponse has completed
Example
<form action="/widgets" method="post">
<input type=text name=name>
<brut-ajax-submit>
<button>Save</button>
</brut-ajax-submit>
</form>