This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes s:url and javascript onclick submit Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "s:url and javascript onclick submit" Watch "s:url and javascript onclick submit" New topic
Author

s:url and javascript onclick submit

E Robb
Ranch Hand

Joined: Aug 27, 2010
Posts: 111
I have one form and two actions. The main action is to log a user into the web site which all works fine. The second action needs to be triggered in the page to retrieve a lost password and should be kicked off by a link. My idea is to use something like
document.forms[0].action = 'LostPassword';document.forms[0].submit();
in the s:url to change the form action but everything I have tried results in a null.

from the properties file:


The form which works fine:


Now the peice of code outside of the form that creates a link. onclick I want it to reset the action & submit the form to a different action. How can I get javascript and an onclick event in the href?


Thanks,
Earl
E Robb
Ranch Hand

Joined: Aug 27, 2010
Posts: 111
DOH! I figured it out

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: s:url and javascript onclick submit
 
Similar Threads
Checkbox fieldvalue does not set action property in IE6 using https.
Struts 2.1 xhtml forms rendering invalid html
Problem with Hidden Tags
Struts 2 <s:submit action > and javascript help
Sending a parameter with <s:url.../>