Solved

How to add this button to my coldfusion code?

Posted on 2012-04-10
2
590 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. 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.: (CODE)

744 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now