Here is what I want to do I have a page that displays members' details having passed the IDs via the url. I want to place a button, that when clicked, the page changes to show additional info such as video and news. I know how to show the button only if there is more to be seen for the particular member. (step 1) My problem is I am not sure how to add a link for the button and to what. I don't know if I need to use a form submit? (step 2) However once I get that figured out I know how to use the <cfif IsDefined (step 3) Can someone please enlighten me here as to how to proceed at step 2 as I am really lost. thanks!
What kind of button are you using, If its an image of a button than just wrap the img tag with a link tag. and stick your url variables in the href attribute, and pass them in the url again: <a href="http://www.theNextPage.cfm[COLOR="Blue"]?somevar=#url.somevar#&nextvar=#url.nextvar#[/COLOR]"><img src="http://www.yourbuttonimage"/><a/> Code (markup): or use a form, you can pass the variables in the url of the action attribute of the form tag or you can use hidden fields. (varibles in blue) OPTION 1: <form action="nextpage.cfm[COLOR="blue"]?somevar=#url.somevar#&nextvar=#url.nextvar#[/COLOR]"> <input type="submit'/> </form> OPTION 2: <form action="nextpage.cfm"> <input type="hidden" [COLOR="blue"]name="somevar" value="#url.somevar#"/>[/COLOR] <input type="hidden" [COLOR="blue"]name="nextvar" value="#url.nexturl#"/>[/COLOR] <input type="submit'/> </form> Code (markup): If you have session management set to true in your application.cfc file you can set your members info to session variables. That way there info stays persistant all the time while the session is active and you can access the session variable from any page without having to pass them from one page to the next. <cfset session.somevar = #url.somevar#> <cfset session.nextvar = #url.nextvar#> (Or you can set these two session var right after you run your query.) To access the sesion variable you simple use <cfoutput>#session.somevar#</cfoutput> or <cfoutput>#session.nextvar#</cfoutput> anywhere in the whole aplication. Code (markup):