Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login




Remember Me
Forgot Password?
Join Us!

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Donate Today!

Do you enjoy these
technical forums?
Donate Today! Click Here

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.
Jobs from Indeed

Link To This Forum!

Partner Button
Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

set variable (cfset) using onclick??

jamestanner (Programmer) (OP)
19 Apr 07 9:15
im trying to set a variable using cfset dependant on what link is clicked, how can i do this? i cant make it work :o(

my code is:

<a href="javascript:document.myform.submit()" class="newsimage" onclick="return <cfset prop_brand='fr0002'>; <cfset prop_name='Cava + Glasses'>; <cfset prop_description='Perfect for center of table'>; <cfset prop_ref='Freixenet'>" onmouseover= "document.getElementById('brandsite').innerHTML='ref: <span class=brandlink> FR0002</span>';document.getElementById('description').innerHTML='freixenet cava<br><br>looks ideal in the center of a dinner table'; document.getElementById('product').innerHTML='freixenet cava + glasses'; changeImages('image2','image2on', 'otherImage', 'otherImage2')" onMouseOut="document.getElementById('brandsite').innerHTML='ref: '; document.getElementById('product').innerHTML='';document.getElementById('description').innerHTML=''; changeImages('image2','image2off', 'otherImage','otherImageDefault')"><img src="images/catalogue/fr0002.gif" alt="fr" name="image2" width="72" height="72" hspace="0" vspace="0" border="0" id="image2"></a>

There are 6 of these on my page (the fr numbers are different as are the image rollovers) but it always sets the values as the last link!!???

when i click on any image, the CFSET does not get set?

how can i achieve this??

Many thanks

jamestanner (Programmer) (OP)
19 Apr 07 9:19
:addition:

i've seen this


<a href="set_the_variable.cfm?animal=leo"> {your image} </a>

set_the_variable.cfm
---------------------
<cflock scope="session" type="exclusive" timeout="30"><cfset session.animal = #url.animal#></cflock>
<cflocation url="my_original_page.cfm" addtoken="no">

as a solution but how would i then make the form submit on return?

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close