4 Replies Latest reply on Dec 3, 2009 6:41 AM by emmim44

    Set session var using js

    emmim44 Level 1

      Hi all, I have small js that is being called when a radio button is clicked. I need that to set a cf session var which will have the radio value so that when the page refresh it will remember what is selected...

       

      <html>
      <head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
      <cfif cgi.PATH_TRANSLATED CONTAINS 'index.cfm'>
        <cfoutput>
         <META HTTP-EQUIV="refresh" content="60;URL=http://#HTTP_HOST#/NEA/index.cfm?location=ALL">
        </cfoutput>
      </cfif>

       

               <script type="text/javascript">
               function select_location(select_me){
                window.location ="index.cfm?location=" + select_me.value;
               }
               </script>
               <input  <cfif url.location eq "NM">checked="checked"</cfif> type="radio" name="location" id="NM" value="NM" onClick="select_location(this);"><label for="NM">NM</label> 
               <input  <cfif url.location eq "SM">checked="checked"</cfif> type="radio" name="location" id="SM" value="SM" onClick="select_location(this);"><label for="SM">SM</label> 
               <input <cfif url.location eq "BQ">checked="checked"</cfif> type="radio" name="location" id="BQ" value="BQ" onClick="select_location(this);"><label for="BQ">BQ</label> 
               <input <cfif url.location eq "MV">checked="checked"</cfif> type="radio" name="location" id="MV" value="MV" onClick="select_location(this);"><label for="MV">MV</label> 
               <input <cfif url.location eq "SI">checked="checked"</cfif> type="radio" name="location" id="SI" value="SI" onClick="select_location(this);"><label for="SI">SI</label> 
               <input <cfif url.location eq "BR">checked="checked"</cfif> type="radio" name="location" id="BR" value="BR" onClick="select_location(this);"><label for="BR">BR</label> 
               <input <cfif url.location eq "HV">checked="checked"</cfif>  type="radio" name="location" id="HV" value="HV" onClick="select_location(this);"><label for="HV">HV</label>
               <input <cfif url.location eq "ALL">checked="checked"</cfif> type="radio" name="location" id="ALL" value="ALL" onClick="select_location(this);"><label for="ALL">ALL</label><br>