Forums Register Login

Need help to display a confirmation message after the form submission

+Pie Number of slices to send: Send
I am submitting a form. I am calling a servlet for from submission. If the form submission is successful I want to show up a confirmation message in the form itself. Can someone help me how to do that.

This is the code of my form in jsp:

<form name="feedbackForm" action="feedback" method="post">
<input type="hidden" id ="uRecid" name="userRecID" value="<%= request.getSession().getAttribute("USERRECID") %>" />
<input type="hidden" id ="appType" name="applicationType" value="AME" />
<input type="hidden" id ="fromFForm" name="fromFeedbackForm" value="Y" />
<div id="messageText">
<textarea id="feedbackText" name="message" rows="5" cols="70" class="dim" onkeypress="return imposeMaxLength(this, 3999);" onclick="javascript:changeClass(this.className, this.id);">The more specific your question or comment, the better service we can provide.</textarea>
</div>
<script>
$(document).ready(function(){
$('form[name=feedbackForm] input[type=submit]').click(function(e){
e.preventDefault();
$('form[name=feedbackForm]')[0].submit();
$('#feedbackText').val('');
});
});
</script>
<div id="message"></div>
<ul class="buttons">
<li class="secondary">
<input type="submit" value="Submit Feedback" />
</li>
</ul>
</form>

 
+Pie Number of slices to send: Send
you can use AJAX..
+Pie Number of slices to send: Send
 

Prasad Krishnegowda wrote:you can use AJAX..


Ajax would be completely unnecessary and a poor way to handle things. Simple JSP can be used (and based upon another post that is exactly what was done).
+Pie Number of slices to send: Send
That is very simple if you capture the onSubmit javascript even and show an alert message or unhide a div tag or use third party attractive messages...
It is no measure of health to be well adjusted to a profoundly sick society. -Krishnamurti Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 2675 times.
Similar Threads
JSP <a href> tags breaks page functionality
Confusing jquery code
Clear a message on page load
set values in a table from other
Can't get to the bean methods
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 15, 2024 22:06:13.