[Last Call] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 174
  • Last Modified:

Passing session variable

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.
  • 2
1 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
JohnLucaniaAuthor Commented:
<input type="image" id="trash#MyInstallments.installID#" src="./images/trash.gif" onclick="document.storePayment.callerId.value=this.id;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)?  
JohnLucaniaAuthor Commented:
I resolved it.  Thank you for all your help on this.

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now