Solved

How to add this button to my coldfusion code?

Posted on 2012-04-10
2
614 Views
Last Modified: 2012-04-10
I have this button is working fine... but I don't know how to add the coldfusion to it.
<!--- <a class="CommonImageTextButton CommonReplyButton" onClick="window.open('addComment.cfm?response_id=#listRelationships.response_id#&topic_id=#listRelationships.topic_id#','child','status=0, toolbar=0, location=0, menubar=0','');">Add a Comment </a>--->


This is my coldfusion code:



 <cfif #isDefined('form.action')# AND #form.action# eq "showCommentInput">
                <cfif form.response_id eq listRelationships.response_id>
                  <textarea name="commentOnResponse" cols="40" rows="5" onKeyPress="return imposeMaxLength(this, 255);"></textarea>
                  <br/>
                  <input type="button" name="btnAddComment" value="Add" onClick="fnChangeCandidate(0)">
                  <input type="button" name="btnCancel" value="Cancel" onClick="location.href='candidate_e_ely.cfm?action=false&&sortBy=#form.sortOptions#&xaction=true&response_id=#listRelationships.response_id#&topic_id=#listRelationships.topic_id#&candidate_id=#form.candidates#'" />
                </cfif>
                <cfelse>
                <cfif listRelationships.candidate_id EQ client.id_number>
                  <input type="hidden" name="candidates_response" value="#listResponses.id#"/>
                  <input type="hidden" name="xaction" value="false" />
                  <input id="editResponse" type="button" name="editResponse" value="Edit Response" onClick="location.href='responseToTopic.cfm?newResponse=false&response_id=#listRelationships.response_id#&topic_id=#listRelationships.topic_id#'" />
                  <cfelse>
                  <!---<input id="addComment" type="button" name="addComment" value="Add a Comment" onClick="location.href='candidate_e_ely.cfm?action=showCommentInput&xaction=true&sortBy=#form.sortOptions#&response_id=#listRelationships.response_id#&topic_id=#listRelationships.topic_id#&candidate_id=#form.candidates#'"/> 	                                    --->
                  <input type="button" id="addComment" name="addComment" value="Add a Comment" onClick="window.open('addComment.cfm?response_id=#listRelationships.response_id#&topic_id=#listRelationships.topic_id#','child','status=0, toolbar=0, location=0, menubar=0','');" />
                </cfif>
              </cfif>

Open in new window

0
Comment
Question by:LelloLello
2 Comments
 
LVL 39

Assisted Solution

by:gdemaria
gdemaria earned 250 total points
ID: 37829697
I don't understand the question, there is already Coldfusion code in your statement...


<a class="CommonImageTextButton CommonReplyButton" onClick="window.open('addComment.cfm?response_id=#listRelationships.response_id#&topic_id=#listRelationships.topic_id#','child','status=0, toolbar=0, location=0, menubar=0','');">Add a Comment </a>

Just make sure it's wrapped by cfoutput tags and it should work...
0
 
LVL 14

Accepted Solution

by:
quizwedge earned 250 total points
ID: 37829826
I think gdemaria answered it, but I'll add one more thing and include the code. make sure you don't have the <!-- and --> in the code as that means it's a comment. So the code should look like

<cfoutput>
<a class="CommonImageTextButton CommonReplyButton" onClick="window.open('addComment.cfm?response_id=#listRelationships.response_id#&topic_id=#listRelationships.topic_id#','child','status=0, toolbar=0, location=0, menubar=0','');">Add a Comment </a>
</cfoutput>

Open in new window

0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

"In order to have an organized way for empathy mapping, we rely on a psychological model and trying to model it in a simple way, so we will split the board to three section for each persona and a scenario and try to see what those personas would Do,…
Developer portfolios can be a bit of an enigma—how do you present yourself to employers without burying them in lines of code?  A modern portfolio is more than just work samples, it’s also a statement of how you work.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.

808 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