• 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
Marshal
Posts: 34965
377
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();
}
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic