File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes How to call Struts action from a javascript function? 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 "How to call Struts action from a javascript function?" Watch "How to call Struts action from a javascript function?" New topic
Author

How to call Struts action from a javascript function?

rk sharma
Ranch Hand

Joined: Jun 25, 2011
Posts: 50

Here is the code for "somefile.jsp"



I am not able to get any action from the above code
when i put some alert to test it's working, but document.form_name.action = "/someAction.do"; line is not showing any effect.
Can anyone help me?

Regards,

RK
vikas byn
Ranch Hand

Joined: Mar 18, 2011
Posts: 78
use javascript like that -

document.forms[0].action = "/someAction.do";
document.forms[0].submit();
 
jQuery in Action, 2nd edition
 
subject: How to call Struts action from a javascript function?
 
Similar Threads
javascript function
form submission
document.getElementById("id").value is not supported in firefox
Problem with struts-menu for second level submenu
Internationalization login thru to...