I am currently doing the same my project...

here is it...

it involves using javascript to change the buttonAction

1. must have a hidden field buttonAction
2. each (Button) submit button must have a property
3. when you click on the button the JS is involked and the hidden
filed buttonAction is set and the form is submitted
4. in your Java class, get the value of the button, if task1, do
task1, if task2 do task 2


hope that helps

-----------------------------------------
<script language="javaScript">
function DoSomething(button)
{
  document.forms[0].buttonAction.value=button.value;
  document.forms[0].submit();
}
</script>

-----------------------------------------------------

<html:form action="doAnotherThing?action=addAnotherThing" >
  <html:hidden property="buttonAction"/>
 
        <p>
    <html:button 
      property="task1" 
      value="Add Property"   
      onclick="DoSomething(this);"
    />
                &nbsp;&nbsp;&nbsp;
          <html:button 
      property="task2" 
      value="Add Property/Sublease"  
      onclick="DoSomething(this);"
    />
                &nbsp;&nbsp;&nbsp;
    <html:reset>
      <bean:message key="button.reset"/>
    </html:reset>
    &nbsp;&nbsp;&nbsp;
    <html:cancel/>
    <%--
      <bean:message key="button.cancel"/>
    </html:cancel>
    --%>
        </p>
</html:form>

-----------------------------------------------------------------------------



On Wed, 23 Mar 2005 14:58:56 -0600, Scott Purcell
<[EMAIL PROTECTED]> wrote:
> Hello,
> I have a form, lets say that has a select list on it.
> Under it I have the ability to
> [edit], [delete], [modify] or [cancel].
> 
> Each of these buttons goes to a different <action />
> 
> but the form page is set for just one of the actions. And to top this off, I 
> cannot do a href_link, I need to submit the form to get the selected value 
> from the form.
> 
> We are using links, but they are css links (See below). One of my guys said 
> we could just use the javascript (see last link) and then change the action 
> of the form, but I was hoping there was a cleaner way.**
> 
> Here is the actual page links.  They appear to only do a href and not a 
> submit, but even if they did submit, I need to change action.
>  The last one calls a javascript, changes the action and submits, but I feel 
> it is not clean.
> Is there a cleaner way to handle this.
> 
> *****Optimal would be a tag that submits to a certain action:******
> 
> <html:link action="/newUser" styleClass="mainLink">New 
> User</html:link>&nbsp;&nbsp;&nbsp;&nbsp;
>     <html:link action="/editUser"  styleClass="mainLink">Edit 
> User</html:link>&nbsp;&nbsp;&nbsp;&nbsp;
>     <html:link action="/deleteUser" styleClass="mainLink">Delete 
> User</html:link>&nbsp;&nbsp;&nbsp;&nbsp;
>     <html:link action="/mainAdmin" styleClass="mainLink">Cancel</html:link>
>     <html:link href="javascript:editUser();" styleClass="mainLink">Foo 
> Bar</html:link>&nbsp;&nbsp;&nbsp;&nbsp;**
> 
> I am sorry for all questions in this regard, but I could use some help.
> 
> Scott
> 
>

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

Reply via email to