You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by nazgultukai <k....@gmail.com> on 2006/11/10 18:46:13 UTC

how to call action from java script

I'm trying to create a web page using JSP,Struts and Javascript...
the page has a form where there are two radio buttons and a menu box.....
now the idea is when one clicks on a radio button the menu will show the
items related to this category....for this I've to use java script on click
function  ..... but I'm not getting how can I call the action from this on
click function ...as I've to use Struts for this application as well...
please help.....

-- 
View this message in context: http://www.nabble.com/how-to-call-action-from-java-script-tf2609331.html#a7281890
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: how to call action from java script

Posted by robin bajaj <ro...@gmail.com>.
Hi there,
I would catch a control's (radionButton etc) event to fire the form's submit 
method to call its action etc.
 - You can catch the onclick event of the radio button and submit the form 
and hence call its action.

<html:form  action="/myaction.do">
    <html:radio value="abc" property="cde" 
onclick="document.forms[form-name-from-struts-config.xml].submit();" />
</html:form>

hope this helps,
robin

----- Original Message ----- 
From: "nazgultukai" <k....@gmail.com>
To: <us...@struts.apache.org>
Sent: Friday, November 10, 2006 12:46 PM
Subject: how to call action from java script


>
> I'm trying to create a web page using JSP,Struts and Javascript...
> the page has a form where there are two radio buttons and a menu box.....
> now the idea is when one clicks on a radio button the menu will show the
> items related to this category....for this I've to use java script on 
> click
> function  ..... but I'm not getting how can I call the action from this on
> click function ...as I've to use Struts for this application as well...
> please help.....
>
> -- 
> View this message in context: 
> http://www.nabble.com/how-to-call-action-from-java-script-tf2609331.html#a7281890
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 


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