Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Save the form data and go back to main page

 
Priya Rengaraj
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 65225
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Priya Rengaraj wrote:But it doesnt work...

Be more specific, please: ItDoesntWorkIsUseless
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic