Cheers Duncan, I actually want to change the content of my second list based onthe first list. I will try the custom tag.
Thanks again Bo ----- Original Message ----- From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, November 24, 2003 10:21 PM Subject: Re: [ cf-dev ] how to transfer variables? > > Firstly, avoid using <cfselect> - you're better to use a real <select> tag. > here's your code rewritten slightly. > > <select name="categoryid" onchange="javascript:window.location.href > ='selectest.cfm?cid=' + > document.form1.categoryid.options[document.form1.categoryid.selectedIndex].value > "> > <cfoutput query="getcategory"> > <option value="#getcategory.categoryid#">#getcategory.category > #</option> > </cfoutput> > </select> > > <select name="productid"> > <cfoutput query="getproducts"> > <option value="#getproducts.productid#">#getproducts.productname > #</option> > </cfoutput> > </select> > > [javascript might be a bit iffy; check it first. if it don't work, call a > function to achieve your end result] > > But are you wanting the user to change page URL when they change the value > in the first select, or are you wanting to change the content of your > second list based on the current value of the first list? If the latter, > remove the onchange code from that first select, and use the custom tag > <cf_twoselectsrelated> instead (http://www.geocities.com/thanny/ ). > > alternatively you could try this custom tag cf_jselect, which i've not > used: > http://www.macromedia.com/cfusion/exchange/index.cfm?view=sn131&extID=1002991 > > > Duncan Cumming > IT Manager > > http://www.alienationdesign.co.uk > mailto:[EMAIL PROTECTED] > Tel: 0141 575 9700 > Fax: 0141 575 9600 > > Creative solutions in a technical world > > ---------------------------------------------------------------------- > Get your domain names online from: > http://www.alienationdomains.co.uk > Reseller options available! > ---------------------------------------------------------------------- > ---------------------------------------------------------------------- > > > > > > > > Bo Jiang > > <[EMAIL PROTECTED] To: [EMAIL PROTECTED] > > nt.ucd.ie> cc: > > Subject: [ cf-dev ] how to transfer > variables? > 24/11/2003 20:21 > > Please respond to > > dev > > > > > > > > > Hi, > > I am a beginner for CF. I want to have two List Menus in a form, and the > second one will be decided by the first one. I wrote a test page, but it > doesn't work. Could anyone tell me how to do that. Thanks a lot. > > My code is followed: > > <cfinvoke component="opps_func" method="getcategoryinfo" returnvariable > ="getcategory"> > <cfif IsDefined("url.cid")> > <cfinvoke component="opps_func" method="getproductinfo" returnvariable > ="getproducts"> > <cfinvokeargument name="cid" value=#url.cid#> > </cfinvoke> > <cfelse> > <cfinvoke component="opps_func" method="getproductinfo" returnvariable > ="getproducts"> > </cfif> > ....... > <cfform name="form1" method="post" action="selectest.cfm"> > <p> > <cfselect name="categoryid" query="getcategory" value="categoryid" display > ="category" > onchange="javascript:window.location.href='selectest.cfm?cid=#categoryid#' > "></cfselect> <------Here, it seems illegal to transfer variable like > this > <cfselect name="productid" query="getproducts" value="productid" display > ="productname"></cfselect> > </p> > </cfform> > ..... > > > > Bo > 24/11/2003 > > > > > > -- > ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ > > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > For human help, e-mail: [EMAIL PROTECTED] >
