struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Close <acl...@gmail.com>
Subject Re: Why does <html:submit> work differently than <html:link action="">?
Date Wed, 28 Jul 2004 21:36:31 GMT
not to fuel the fire from the previous discussion, but this situation
works fine if <a href> is used instead of <html:link>

example:

<pre>

<html and all that stuff...>

<script language=javascript>
function submitOne() {
  forms[0].myHiddenField.value = "ValueOne";
  forms[0].submit();
}

function submitTwo() {
  forms[0].myHiddenField.value = "ValueTwo";
  forms[0}.submit();
}
</script>

<html:form action="/myAction.do method="post">
  <html:hidden name="myActionForm" property="myHiddenField" />

  now use an anchor tag instead of the Struts anchor tag:

  <a href="#" onclick="submitOne();" >Submit the form with a link</a>

  <a href="#" onclick="submitTwo();"> Submit with a different value</a>

</html:form>

.
.
.
</pre>

hopefully that will help anyone else that was attempting to do goofy
form submissions using links. ;)

andy

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message