EasyCFM.COM ColdFusion Forums / Coding Help! / Pass var as anchor

   Reply to Discussion | New Discussion << previous || next >> 
Posted By Discussion Topic: Pass var as anchor

book mark this topic Printer-friendly Version  send this discussion to a friend  new posts last

Shalinko
02-15-2013 @ 1:02 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Junior Member
Posts: 107
Joined: Sep 2007

I did search the forums here as I thought this must be a common question, but found nought..
I want to include a variable ID in my URL which will then jump to a variable anchor point in the next page....not clear, I
know! First page is output query of a list of lessons, each row has a link to a 'notes' page where all notes for all lessons
are out put. I want to pass the lesson_ID in the URL, and in the next page have a variable named anchor which corresponds to
it so that it jumps to that specific note.

My link to the notes page looks like this:

<a href="lesson_notes_all.cfm?lesson_ID=#attend.lesson_ID#&student_ID=#attend.student_ID#&#####attend.lesson_ID#" target="_self"
title="View Details">

and in the browser like this:

http://localhost:8500/vantage/admin/lesson_notes_all.cfm?lesson_ID=859&student_ID=104&##859

and the notes page output looks like this (I'm not sure how to name the anchor? Should it correspond to the URL var, or the
output query on that page?):

<cfoutput query="notes">
  <a name="#notes.lesson_ID#"></a>
    <table  width="95%" height="40" border="0" align="center" cellpadding="2" cellspacing="2" class="admin">     
                    <tr>
                      <td valign="bottom"><span class="style1">#DateFormat(notes.lesson_date, 'dddd dd  mmmm, yyyy')# at
#notes.lesson_time# (#notes.location#) </span></td>
                    </tr>
                    <tr>

Maybe this a really stupid question, but I just can't see it! Frown

This message was edited by Shalinko on 2-15-13 @ 1:16 AM

megan
02-15-2013 @ 7:11 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Moderator
Posts: 2398
Joined: Jan 2003

Try surrounding the text for the parameters with single quotes and placing the anchor tag after.

http://localhost:8500/vantage/admin/lesson_notes_all.cfm?'lesson_ID=859&student_ID=104&'##859

hth ~megan

-------------------------------------------------------
"The chief cause of failure & unhappiness is trading what you want most for what you want now." ~Zig Ziglar

This message was edited by megan on 2-15-13 @ 7:13 AM

Shalinko
02-15-2013 @ 7:23 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Junior Member
Posts: 107
Joined: Sep 2007

Thanks megan but that doesn't seem to help, I tried a few
variations on it but nothing seems to work...?
Is what I'm trying to do in principal a workable idea?

This message was edited by Shalinko on 2-15-13 @ 7:24 AM

megan
02-15-2013 @ 7:28 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Moderator
Posts: 2398
Joined: Jan 2003

OK try moving the first single quote down like this (I tried it and it works for me)

.cfm?lesson_ID='859&student_ID=104&'#859

hth megan

-------------------------------------------------------
"The chief cause of failure & unhappiness is trading what you want most for what you want now." ~Zig Ziglar

Shalinko
02-18-2013 @ 12:00 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Junior Member
Posts: 107
Joined: Sep 2007

Thanks megan, but it doesn't want to work for me...I
tried a few other combinations but either got errors or
just the page displayed as normally with no anchor point.
What did you name the anchor point? Was it hard coded or
a variable?

megan
02-18-2013 @ 6:37 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Moderator
Posts: 2398
Joined: Jan 2003

Sorry Frown  - then I don't know what to tell you - that setup did work for me on firefox and Railo 4 - maybe someone else will have an answer

-------------------------------------------------------
"The chief cause of failure & unhappiness is trading what you want most for what you want now." ~Zig Ziglar

Shalinko
02-18-2013 @ 7:09 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Junior Member
Posts: 107
Joined: Sep 2007

Sure, thanks for trying. I will experiment a bit more
...:-D

megan
02-18-2013 @ 7:14 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Moderator
Posts: 2398
Joined: Jan 2003

I didn't see the last part of your question - the anchor point (the place in the page where the browser goes to and stops) was hard coded into the page text

-------------------------------------------------------
"The chief cause of failure & unhappiness is trading what you want most for what you want now." ~Zig Ziglar

Shalinko
02-18-2013 @ 7:18 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Junior Member
Posts: 107
Joined: Sep 2007

Ok, thanks, so I'll look at how I'm outputting the anchor
point coz that must be where the problem is. Thanks again
for narrowing it down a bit.

megan
02-18-2013 @ 7:23 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Moderator
Posts: 2398
Joined: Jan 2003

I did something like <a id="859">Some text here</a> also the page has to be long enough / have enough content
take care, Megan

-------------------------------------------------------
"The chief cause of failure & unhappiness is trading what you want most for what you want now." ~Zig Ziglar


Website Designed and Developed by Pablo Varando.