Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trouble Setting a Session Variable

Status
Not open for further replies.

khurram

IS-IT--Management
Jan 10, 2001
95
CA
I have the following code. What I want is that when the browser selects the country, the page will automatically advance. No problem. But I also want to set the session variable. How do I do that?

<SELECT name=&quot;SelectCountry&quot; onChange=&quot;self.location.href='/shop/hubs/builder/index.cfm'&quot;>
<CFOUTPUT query=&quot;SelectCountry&quot;>
<CFIF #CountryID# EQ &quot;CAD&quot;>
<OPTION value=&quot;#CountryID#&quot; selected>#CountryName#</OPTION>
<CFELSE>
<OPTION value=&quot;#CountryID#&quot;>#CountryName#</OPTION>
</CFIF>
</CFOUTPUT>
</SELECT>

Where does this go?

<CFSET #Session.sCountry# = &quot;this[this.selectedIndex].value&quot;>
 
Hi,
You can set the session variable at the begining of the second page (index.cfm) as the followin':

<CFSET Session.countryID = #Form.SelectCountry#> <Always there's a solution></Always there's a solution>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top