struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Roderick" <Chris.Roder...@cern.ch>
Subject RE: Appending html:option to a html:link
Date Thu, 01 Jul 2004 13:13:39 GMT
Thank you for your reply.

The only thing that is missing from this are the map of attributes that
I was originally appending to the html:link.  Is it a case of - you can
have one or the other?

Cheers,

Chris

> -----Original Message-----
> From: McCormack, Chris [mailto:Chris.McCormack@littlewoods.co.uk]
> Sent: 01 July 2004 15:07
> To: Struts Users Mailing List
> Subject: RE: Appending html:option to a html:link
> 
> Dont think its possilbe unless you use a bit of javascript.
> As its lunchtime I have knocked out a bit of a solution in javascript
(not tested).
> 
> 
> <script language="javascript">
> 
>   var queryString = "?";
>   var count = 0;
> 
> function appendToUrl(newValue){
> 
> 	queryString +="&"+count+"="+newValue;
> 
> }
> 
> function doLink(link){
> 
>        location.href=link+queryString;
> }
> 
> </script>
> 
> 
> <html:select name="VectorInfoForm" property="chartFormat"
> onChange="appendToUrl(this.options[selectedIndex].text)" size="1">
> 
>   <html:option value="1">DHTML</html:option>
> 
>   <html:option value="2">Java</html:option>
> 
> </html:select>
> 
> <a href='"javascript:doLink("SingleVectorChartAction.do")'>click
meh</a>
> 
> -----Original Message-----
> From: Chris Roderick [mailto:Chris.Roderick@cern.ch]
> Sent: 01 July 2004 13:49
> To: user@struts.apache.org
> Subject: Appending html:option to a html:link
> 
> 
> Hi,
> 
> 
> 
> I have a JSP page that has a list of hml:links, each with a map of
> attributes appended e.g.:
> 
> 
> 
> <html:link href="SingleVectorChartAction.do?" name="attributes">
> 
>   chart
> 
> </html:link>
> 
> 
> 
> (where attributes is a map).
> 
> 
> 
> On the same page, I have a html:select e.g.:
> 
> 
> 
> <html:select name="VectorInfoForm" property="chartFormat" size="1">
> 
>   <html:option value="1">DHTML </html:option>
> 
>   <html:option value="2">Java</html:option>
> 
> </html:select>
> 
> 
> 
> When a user clicks on the link, I would like to append the currently
> selected option from the html:select to the link, without submitting
the
> form.
> 
> 
> 
> Does anybody know if this is possible, and if so - how?
> 
> 
> 
> Thank you in advance,
> 
> 
> 
> Chris
> 
> 
> ***********************************************
> This e-mail and its attachments are confidential
> and are intended for the above named recipient
> only. If this has come to you in error, please
> notify the sender immediately and delete this
> e-mail from your system.
> You must take no action based on this, nor must
> you copy or disclose it or any part of its contents
> to any person or organisation.
> Statements and opinions contained in this email may
> not necessarily represent those of Littlewoods.
> Please note that e-mail communications may be monitored.
> The registered office of Littlewoods Limited and its
> subsidiaries is 100 Old Hall Street, Liverpool, L70 1AB.
> Registered number of Littlewoods Limited is 262152.
> ************************************************
> 
> 
> ---------------------------------------------------------------------
> 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


Mime
View raw message