Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Submitting a Form Using A Link ....

 
Matt Connors
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
author & internet detective
Sheriff
Posts: 35762
412
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Itenas
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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();
}
 
And will you succeed? Yes you will indeed! (98 and 3/4 % guaranteed) - Seuss. tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!