how to submit multiple forms simultaneously and then hide respective responses(and parse through responses in code) in a jsp/java web app
I have a page where multiple forms are submitted to different 3rd party sites...I want to hide the responses and then parse through them using my code (I already have the success/failed开发者_如何学编程 submission response messages with me.. I can check each response for existence of such a message).
One possible solution is to assign a target frame to each form, then hide display of each such frame.. However in such case is it possible to store each response in hard disk or parse through it(to check for success/failure message)? I want to do this in a jsp/java web app...
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>
精彩评论