Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shorter plugin initialization and set reset/clear form options through data attributes #400

Merged
merged 2 commits into from
Feb 20, 2017

Conversation

izziaraffaele
Copy link
Contributor

With this pull-request you'll have 2 new small features:

  • Shorter plugin initialization. For me it's really useful expecially when I have to use ajaxSubmit and I have to build the url dinamically or I have to get extra data. This feature works for both ajaxForm and ajaxSubmit.
$( '#form' ).on('submit',function(e){
     e.preventDefault();
     // get extra data or build url
     $(this).ajaxSubmit( url, data, dataType, function(response){
             //success callback function
     });
});
  • You can use data attributes to set resetForm/clearForm options. Useful when you have general settings for most of the forms and you need an easy way to customize special forms while you are printing them out.
<form action="" method="POST" data-reset="true"></form>
<form action="" method="POST" data-clear="true"></form>

@izziaraffaele izziaraffaele changed the title Shorter plugin initialization and reset/clear form through data attributes Shorter plugin initialization and set reset/clear form options through data attributes Mar 22, 2014
@kevindb
Copy link
Contributor

kevindb commented Jan 15, 2017

This pull request was committed into the maintained fork of this plugin at 748a67c

@kevindb kevindb merged commit 8e7cac8 into jquery-form:master Feb 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants