Reputation: 319
I have a JSP web page where multiple forms are shown at a time. I want to create one button that submits all forms to their respective actions. Can this be done? How to implement this? All the forms belong to different 3rd party sites.
Upvotes: 1
Views: 7540
Reputation: 27614
Ajax post. For example, use jQuery and the jQuery Form plugin.
Then something like this to submit all forms with a button click
<input type="button" value="Submit all" id="submitAll">
<script type="text/javascript">
$(document).ready(function() {
$('#submitAll').click(function() {
$('form').ajaxSubmit({
success: function(responseText, statusText, xhr, $form) {
alert('form submitted, return status:' + statusText);
}
});
});
});
</script>
Upvotes: 2