File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 Head First Android this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Submitting a Form Using A Link ...." Watch "Submitting a Form Using A Link ...." New topic

Submitting a Form Using A Link ....

Matt Connors

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?

Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 32312

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.

[OCA 8 book] [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

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

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

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

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

I agree. Here's the link:
subject: Submitting a Form Using A Link ....
It's not a secret anymore!