If you do not want it in the querystring at all use method="post" for the form instead. This must be some very old code, I have not seen parameterexists used in years, you do realise that everything in the querystring exists in the URL scope right ? So you can just remove items from the URL struct, then loop over it and create a list from the URL struct to use this as the new querystring.
e.g. <cfset structDelete(URL,"language")> <cfparam name="QS" default=""> <cfloop collection="#URL#" item="key"> <cfset QS = ListAppend(QS,key,"&")> </cfloop> On Sun, Jan 9, 2011 at 10:28 PM, fun and learning <[email protected]>wrote: > > Hi All - > > I have the following piece of code. > > <form name="langchooser" action=""> > <select name="language" size="1" > onChange="javascript:if(this.form.language.options[this.form.language.selectedIndex].value!='null'){location.href=this.form.language.options[this.form.language.selectedIndex].value}" > class="select2"> > > <!--- > WHAT A piece of c??? > #cgi.query_string#&language=#langcode# IS WAY OFF; ---> > > <cfoutput query="languages"> > > <!--- <cfset structdelete(cgi.query_string,"language")> ---> > <cfif parameterexists(switch) is "yes"> > > <option > value="index.cfm?#cgi.query_string#&language=#langcode#&switch=#switch#" > <cfif session.language eq langcode> > selected > </cfif>>#evaluate(session.language & > "_language")#</option> > <cfelse> > <option > value="index.cfm?#cgi.query_string#&language=#langcode#" > <cfif session.language eq langcode> > selected > </cfif>>#evaluate(session.language & > "_language")#</option> > </cfif> > </cfoutput> > </select> > > </form> > > As you can see in the options, For the first time I need the 'language' > parameter. But when the I change the drop down, the language parameter gets > added to the #CGI.querystring#. And on the second refresh, the language > variable gets added again to the querystring. Is there a way I can delete > the variable from the query string before i change the language option in > the drop down? > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340597 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

