Hi all,

i have an intermediary page that has two links and two hidden fields
on it.  when i click on a link i would like to be able to submit my
form (hidden fields) to the appropriate page.  i've tried using the
links with forward and with action but they don't appear to 'submit'
the form.  they just take me to the next page.  so i've added onclick
attributes and reassign the action to the form and submit the form,
but now i'm getting errors that i suspect are javascript.  using a
regular submit button submits the form correctly, but isn't an option
in this case.
is there any other way to get around this issue?  or a  better way to
submit a form using a link tag?

here is my form:

<html:form action="/addItemsByProdNbr.do method="post">
  <html:hidden name="shoppingListForm" property="selectedShoppingList" />
  <html:hidden name="shoppingListForm" property="selectedShoppingListGroup" />
  <!--html:submit /-->  <!-- this works if i add a prodType attribute
to the action above... -->
    <table width="601" align="center" cellpadding="10">
      <TR>
        <TD align="center">
          <html:link forward="addMemberByProdNbr"
onclick="sl_addMemberProdNbrs(this.form);" >
            <Strong>Internal Product Number</Strong>
          </html:link>
        </TD>
      </TR>
      <TR>
        <TD align="center">
          <html:link forward="addNonMemberByProdNbr"
onclick="sl_addNonMemberProdNbrs(this.form);" >
            <Strong>NON Internal Product Number</Strong>
          </html:link>                                          
        </TD>
      </TR>
  </TABLE>
</html:form>
...

the javascript functions are extremely simple and work elsewhere:

function sl_addMemberProdNbrs(frm) {
  frm.action += "?prodType=Member";
  frm.submit();
  return;
}

function sl_addNonMemberProdNbrs(frm) {
  frm.action += "?prodType=NonMember";
  frm.submit();
  return;
}

and my action mapping:

<action path="/addItemsByProdNbr"
parameter="prodType"
type="com.usfood.usfdc.domain.sl.controllers.SLAddAction" 
name="shoppingListForm" >
<forward name="success" path="/jsp/SList/SLAddItemsByProdNbr.jsp" />
<forward name="failure" path="/jsp/SList/SLError.jsp" />
</action>
                
any suggestions would be greatly appreciated.
thanks
andy

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to