wood burning stoves
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 REST with Spring (video course) this week in the Spring 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: 32819

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]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, 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

It is sorta covered in the JavaRanch Style Guide.
subject: Submitting a Form Using A Link ....
It's not a secret anymore!