struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Close <>
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>



<html and all that stuff...>

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

function submitTwo() {
  forms[0].myHiddenField.value = "ValueTwo";

<html:form action="/ 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>



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


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message