You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Stetze2008 <st...@gmx.de> on 2008/06/04 21:12:43 UTC

s:select - execute action onChange

hi I'm sorry but I did not find a quick solution for my problem on the web.

I want to execute an action if another value of the select-box was selected.
So i guess I have to use the onChange attribute but I dont know how.

this is my actual form:

    <s:form action="changeDefaultScope" namespace="/user" method="POST" 
theme="simple">
                <s:select list="myList" key="label.allscopes"
                    listKey="id" listValue="name" value="myValue" 
emptyOption="false" name="scopeId" theme="simple" />
                <s:submit  key="button.changeScope" theme="simple" />
    </s:form>

I would like to call the action without the submit button. (Javasscript 
- onChange)

Can anybody help? Thanks in advance.

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


Re: s:select - execute action onChange

Posted by Felipe Lorenz <fe...@gmail.com>.
Hi. What action? A action to update another select, i.e.?

I use something like this:

onChange="jsFunction(this.value);"

function jsFunction( id ) {
  var div = dojo.widget.byId("<my div>");
  div.href = "myAction?myField="+id;
  div.refresh();
}

That is it?

On Wed, Jun 4, 2008 at 4:12 PM, Stetze2008 <st...@gmx.de> wrote:

> hi I'm sorry but I did not find a quick solution for my problem on the web.
>
> I want to execute an action if another value of the select-box was
> selected.
> So i guess I have to use the onChange attribute but I dont know how.
>
> this is my actual form:
>
>   <s:form action="changeDefaultScope" namespace="/user" method="POST"
> theme="simple">
>               <s:select list="myList" key="label.allscopes"
>                   listKey="id" listValue="name" value="myValue"
> emptyOption="false" name="scopeId" theme="simple" />
>               <s:submit  key="button.changeScope" theme="simple" />
>   </s:form>
>
> I would like to call the action without the submit button. (Javasscript -
> onChange)
>
> Can anybody help? Thanks in advance.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>