javascript - How do you use twitter bootstrap button with jquery? -
What do I want to do, when a user clicks the submit button in the forum, then send it to collect data Php script and ideal, stay on the same page. Currently, I have a form (I have other tags, but these are two things that I need to pay attention to)
However, I have a simple jquery I would like to create a script, where you click on the button that send the data using AJAX. I see Twitter works differently with Bootstrap Buttons and I'm not sure how to use your buttons with jquery Any help with this will be great.
So,
- I should know how to use the Twitter Bootstrap button with jquery, in particular, I have to figure out how to use the submit button To do.
- How can I send data using AJAX?
- I have to find out that twitter bootstrap button with jquery How To Use Specially, I need to figure out how to use the submit button.
How to do jQuery & amp; The bootstrap is still the same together
- How is the data sent using ajax?
First we have inserted the event click on the Submit button in the #nutth , then the Ajax statement Write as a handler. Example: & lt; Name of the form = "Answer" id = "answerForm" verb = "sqlinserter.php" method = "post" & gt; & Lt; Button ID = "new thread" class = "btn btn-primary" type = "submit" & gt; Submit & lt; / Button & gt; & Lt; / Form & gt; ('Click', function (e) {e.preventDefault} on JS
$ (function () {$ ('# newThread') (.); // Disable the default form; Submit event var $ form = $ ('# response form'); $ .aex ({url: $ form.attr ("verb"), type: $ form.attr ("Method"), data: $ form.serialize (), success: function (response) {warning ('response received'); // ajax success callback}, error: function (feedback) {warning ('ajax fail' ); // Ajax error callback}}}}}}};});
Comments
Post a Comment