Passing session variable

Posted on 2006-05-22
Last Modified: 2013-12-24
Is it possible to pass a session variable from a mouse-click on gif, radio button, or checkboxes?
I prefer to have a session variable solution for gif.   I want to pass a session variable when a gif is clicked where there are multiple gifs from cfloop and all of the gifs have a unique value with hidden fields if needed.  
If it is not possbile with gif, I prefer to have the solution with checkboxes and/or radio buttons.
Please show me examples.
Question by:JohnLucania
    LVL 9

    Accepted Solution

    If it is a session variable, then it will be available on every page once it has been set for the lenght of the user session or until you delete the var.  

    You can use form variables, and either post them to the next page or add them to the query string.  For the example you describe, you might best be served with radio/checkboxes.

    <form name="gif_form" method="post" action="form_process.cfm">
      <cfloop from="1" to="10" index="n">
          <input type="radio" name="gif_select" value="some_value_to_be_determined_#n#"> //put gif or text here  </br>  

      <input type="submit" value="Submit">

    //- note you can build the list as shown above or you can put the form items into a table.  Just depends on your needs

    Author Comment

    <input type="image" id="trash#MyInstallments.installID#" src="./images/trash.gif" onclick=";return redirectForm('<cfoutput>#MyInstallments.installID#</cfoutput>');" />
    where onclick redirects to the page after the data submission.

    If I use gif, would it be:
    <input type="image" id="trash#MyInstallments.installID#" src="./images/trash.gif" value=#MyInstallments.installID#> ?
    then, how do you get the #MyInstallments.installID# on the next page?

    If not possible, how do you get the #MyInstallments.installID# when you you are using checkboxes (for multiple variable passing)?  

    Author Comment

    I resolved it.  Thank you for all your help on this.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    In our day to day coding, how many times have we come across a necessity to check whether a URL is a broken link or not? For those of you that answered countless and are using ColdFusion like myself, then this article is for you.  It will show yo…
    When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now