Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Javascript function within struts form

 
Parijat Mukherjee
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a form in which i have a drop down menu with actions like
"manage", "add new" , "delete" etc now when the user selects an action from the menu and on click of "ok" button next to it a javascript function is called.
now on selecting "add new" and on click of "ok " button i wan't the user to be taken to a new jsp .
in the struts-config.xml i have an action path as shown :
<action path="/setupEditProjectForm" forward="/com/bofa/mdi/web/jsp/projectEditForm.jsp"/>
can anyone please tell me what should i write in the javascript function
so that the projectEditForm.jsp is called.Pls help urgently
 
poornima balagopal
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
In the he action which you are writing for the click action ,try to give the path to anew page as you gave in the forward. Give the same path in the script as
submitType()
docuement.forms[0].action="taketonew.do";
document.forms[0].submit();
<hr/>
You can substitute the forms[0] with the form name if you have any.
On the click of the button give it as
<hr/>
"javaScript:submitType()"
<hr/>
Try this .hope this will help you
all the best.
poornima
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic