aspose file tools*
The moose likes Struts and the fly likes Javascript function within struts form Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Javascript function within struts form" Watch "Javascript function within struts form" New topic
Author

Javascript function within struts form

Parijat Mukherjee
Greenhorn

Joined: Sep 21, 2003
Posts: 26
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

Joined: Dec 02, 2003
Posts: 83
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Javascript function within struts form
 
Similar Threads
Getting the following Exception
Struts Action Invocation
Check for File Exists using Javascript
same jsp page for add and edit
"enter key" button focus ?