This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
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

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

Save the form data and go back to main page

Priya Rengaraj

Joined: Dec 20, 2011
Posts: 1

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 The create page looks like

<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"; .........../>

javascript function:

document.createEmpForm.action = "EmployeeMain.jsp";

But it doesnt work...

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

Joined: Jan 10, 2002
Posts: 63202

Priya Rengaraj wrote:But it doesnt work...

Be more specific, please: ItDoesntWorkIsUseless

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: Save the form data and go back to main page
It's not a secret anymore!