wood burning stoves 2.0*
The moose likes JSP and the fly likes Save the form data and go back to main page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Save the form data and go back to main page " Watch "Save the form data and go back to main page " New topic
Author

Save the form data and go back to main page

Priya Rengaraj
Greenhorn

Joined: Dec 20, 2011
Posts: 1
Hi,

Please help me on the following:

I have a employee main jsp which where employeee search is performed. On the same page, I have a button to Create an employee. (createEmployee.jsp) .
In the createEmployee Page , when I enter the form data and click on save button, I need to submit the form and save the data and also go back to main page displaying the created employee information in the main page.

I need to use document.form.action and submit and need not window.open............ The create page looks like

<html>
..........
<form action = "createEmployee.jsp" method = "post" name = "createEmpForm">

.......... Form elements and data .............
........... Scriplets to call methods that save data....

<button name = "Save" onclick = "onSave()"; type = "submit"; .........../>
</form>

javascript function:

onSave(){
document.createEmpForm.action = "EmployeeMain.jsp";
documen.createEmpForm.submit();
}


But it doesnt work...

Please help with sample codes if possible.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60783
    
  65

Priya Rengaraj wrote:But it doesnt work...

Be more specific, please: ItDoesntWorkIsUseless


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Save the form data and go back to main page
 
Similar Threads
populate the form field with the submitted input
Help me with session tracking example
Form Tokens
Add new text field on each press of a button and retrieve values
add a new text field at every press of a button