Saturday, May 25, 2024
 Popular · Latest · Hot · Upcoming
9
rated 0 times [  15] [ 6]  / answers: 1 / hits: 30011  / 13 Years ago, tue, january 24, 2012, 12:00:00

I have one form in JSP. I have some input fields in that page, when user types his values then he clicks submit so that values will be inserted into the database.



But my purpose is that when user clicks submit button then one new popup window will be generated and this new popup window will carry those values at the time of inserted values in parent window. Ex: first page: Insert.jsp and popup window: Verifyinsert.jsp. In Insert.jsp page 3 input fields are present such as roll number, student name, address. User will enter these 3 fields first on Insert.jsp page and then user will click submit on Insert.jsp page, then one new popup window(Verifyinsert.jsp) will be generated carrying values when user just has typed in Insert.jsp and in that Verifyinsert.jsp page, submit button is present and if user clicks submit then records will be inserted into database and if cancel button will be clicked on Verifyinsert.jsp then that popup window will be simply disappeared. How to do it?



Any help is much appreciated.


More From » jquery

 Answers
12

Use onSubmit event



<html>
<head>
<script type=text/javascript>
function greeting(){
alert(Welcome + document.forms[frm1][fname].value + !)
}
</script>
</head>
<body>

What is your name?<br />
<form name=frm1 action=submit.htm onsubmit=greeting()>
<input type=text name=fname />
<input type=submit value=Submit />
</form>

</body>
</html>

[#87835] Sunday, January 22, 2012, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
deiong

Total Points: 15
Total Questions: 103
Total Answers: 99

Location: Sudan
Member since Thu, May 7, 2020
4 Years ago
;