aspose file tools*
The moose likes Struts and the fly likes Submitting a Form Using A Link .... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Submitting a Form Using A Link ...." Watch "Submitting a Form Using A Link ...." New topic
Author

Submitting a Form Using A Link ....

Matt Connors
Greenhorn

Joined: Sep 08, 2004
Posts: 23
I would like to know if it is possible, without using javaScript, to submit a form using a hypertext link.

Does Struts provide any support for this?

thanks.
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 29274
    
140

Matt,
You can submit a form if you know the parameters and their values in advance:

You can't submit an actual form where the values change without using JavaScript.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Itenas
Greenhorn

Joined: Oct 29, 2004
Posts: 3
you can use

<a href="javascript:test()">...</a>

:: Just provide the javascript test() to submit the form.

e.g.
function test()
{
.... // validations or whatever you need to do first

document.forms[0].method="POST";
document.forms[0].submit();
}
 
Consider Paul's rocket mass heater.
 
subject: Submitting a Form Using A Link ....
 
Similar Threads
Links without JavaScript
How to add back button using JSTL?
Moving Circles
Cab you Post using a link ? dont want to use "get"
Hide URL