File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Javascript function within struts form" Watch "Javascript function within struts form" New topic

Javascript function within struts form

Parijat Mukherjee

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
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
You can substitute the forms[0] with the form name if you have any.
On the click of the button give it as
Try this .hope this will help you
all the best.
I agree. Here's the link:
subject: Javascript function within struts form
It's not a secret anymore!