Thanks Kusuma,
It worked like a Charm!
Kusuma Haranath Atmakuri wrote:
>
> try something like this:
>
> function callRelatedAction(actionName) {
> var testForm = document.getElementById('test');
> testForm.action=actionName;
> testForm.submit();
> }
>
>
>
> ________________________________
> From: hisameer <[email protected]>
> To: [email protected]
> Sent: Tue, April 13, 2010 1:21:38 PM
> Subject: S:radio onchange call an action
>
>
> Hi,
>
> I am having radio buttons in my jsp page with three selections:
>
> (o) Login
> (o) Returning user
> (*) Register
>
> Register is selected default. But if the user selects Login or Returning
> User I want to call an action on the onchange event which has to do some
> business logic and redirect the page to another one.Is it possible? I
> tried
> but couldn't get it working. Here is the code:
>
> <s:form id="test" action="usertypeAction" method="post" validate="true">
> <table width="100%" border="0" align="left" cellpadding="0"
> cellspacing="2">
> <tr>
> <td class="contentheadertext" align="left"
> height="30px"> </td>
> </tr>
> <tr>
> <td width="100%" colspan="2" class="contentheadertext"
> align="center">
> <s:radio name="userType" list="#session.userTypes"
> onchanage="Call the
> related_user_action"/>
> </td>
> </tr>
> ...
> Some more code here
> ...
> </s:form>
>
> on the onchange event I want to call related_user_action Action instead of
> main form action: usertypeAction. so I am not able to use form.submit()
> method on the onchange.
>
> I only need help in the onchanage="Call the related_user_action" part
> since
> I dont know how to achieve that. Please post your suggestions.
>
> --
> View this message in context:
> http://old.nabble.com/S%3Aradio-onchange-call-an-action-tp28233918p28233918.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
>
>
--
View this message in context:
http://old.nabble.com/S%3Aradio-onchange-call-an-action-tp28233918p28260241.html
Sent from the Struts - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]