You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Mark Galbreath <ma...@qat.com> on 2003/05/14 20:56:32 UTC

RE: sending value in param on html:select using javascript

This is relatively easy to do.  First, download a great online reference:

http://developer.netscape.com/docs/manuals/ and look at event handlers,

then think about the <html:form> attribute "onsubmit:"

http://jakarta.apache.org/struts/userGuide/struts-html.html#form

Mark

-----Original Message-----
From: Vangelis Konstantinis [mailto:Vangelis.Konstantinis@eurodyn.com] 
Sent: Tuesday, January 14, 2003 2:42 PM
To: Struts Users Mailing List
Subject: Re: sending value in param on html:select using javascript


Ian hi,

I am new to Struts FrameWork and I have the same problem.

I want on change event of <html:select> to refresh my form and to take new
data.

MyForm - > Action -> Form Again

You take the id of <html:select> and save it to hidden field and then submit
the form????

How do you do this????

I use dispatch Action too.

How do you pass the selected paramenter, and the action you want to execute?

Thanks in advance.

Vangos.
Ian Hunter wrote:

> I use DispatchAction and set the "parameter" or command to something 
> different with JavaScript, then submit the form.  I handle all the 
> tough stuff in the Action class.
>
> ----- Original Message -----
> From: "Michael C. Lee Jr." <ml...@hotmail.com>
> To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> Sent: Tuesday, April 22, 2003 10:32 AM
> Subject: sending value in param on html:select using javascript
>
> How do you call another jsp when an onchange event occurs on 
> html:select with the selected value in the parameter list?
>
>             <html:select property="userRole" size="1">
>                 <html:option value="">Select User Role</html:option>
>                 <html:options collection="allUserRoles" property="key" 
> labelProperty="value"/>
>             </html:select><font class="bodytextred">*</font>
>
> I want to add an option on html:select for 
> onchange="location.href='/somewhere/some_jsp.jsp?value=***************
> *'"
> I want to put what the selected option is where the ************** is. Any
> ideas?
> thanks,
> Mike
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org


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



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