This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Struts and the fly likes change the action just before the submit Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "change the action just before the submit" Watch "change the action just before the submit" New topic
Author

change the action just before the submit

shailesh kumar
Ranch Hand

Joined: Jul 18, 2005
Posts: 36
Hi All,
I am trying to change the action just before the submit, I tried this javasctipt but this doesn't work, any ideas would be appreciated. This Javascript is called on Select OnChange event.


Hussain Fakhruddin
Ranch Hand

Joined: Aug 13, 2004
Posts: 96
Its not working because you are missing the the module name which html:form detect by it self

for eg if your project folder is school then the code would be like this


or you can try this too



Hussain Fakruddin<br /> <br /><b>IBM 486-OOAD with UML</b>
shailesh kumar
Ranch Hand

Joined: Jul 18, 2005
Posts: 36
It didn't work either that way, I think some thing else is missing..!!
Ram kovis
Ranch Hand

Joined: Jun 23, 2005
Posts: 130
may be problem with " { " mismatching..
pls check ..
give some alert() and see, whether you are going inside if
A Harry
Ranch Hand

Joined: Jan 23, 2002
Posts: 124
looks to me like you're missing the ".do" bit & have a "/"

I do the same thing & would use something like -

document.forms[0].action = "populateTypes.do"

hope this help!
Slava Lovkiy
Greenhorn

Joined: Aug 17, 2005
Posts: 29
Did you actually get error telling that specified url not availble or javascript doesn't change the action at all ?

If you have standart url mapping in our web.xml to "*.do" than it should be ok to specify the url like "someaction.do", i.e. w/o leading "/".
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: change the action just before the submit