Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

change the action just before the submit

 
shailesh kumar
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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

 
shailesh kumar
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It didn't work either that way, I think some thing else is missing..!!
 
Ram kovis
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
may be problem with " { " mismatching..
pls check ..
give some alert() and see, whether you are going inside if
 
A Harry
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 "/".
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic