You need to sign in to do that
Don't have an account?
kirubakaran viswanathan
How to use <a> tag inside Apex:outputText in Visualforce?
I need to display the email id with link based on program name in a para. How can I acheive in VF?
<p class = "doc-preview__copy txindent"> If you have any questions regarding your next steps, please contact the {!TargetX_SRMb__Application__c.Program_Name__c} admissions team <apex:outputText value="{!IF(app.Program_Name__c == "abc", <a href="mailto:abc@abc.com">abc@abc.com</a>.,a href="mailto:123@abc.com">123@abc.com</a> ')}" /> </p>I am getting syntax error or EL Expression unbalanced error.
You can simply use the anchor tag to achieve this functionality
<apex:outputText label="fieldLabel" value="{!Object.fieldValue}"/>
<a href="javascript:window.open('url')">
Change
</a>
And with the use of outputLink:
<apex:outputLink onclick="javascript:window.open('url')">
Change
</apex:outputLink>
refer this url:
https://salesforce.stackexchange.com/questions/46318/outputtext-with-link
http://www.infallibletechie.com/2013/02/apexoutputlink-in-salesforce.html
Please mark it as best Answer if you find it helpful.
Thank You
Ajay Dubedi
How can use with IF logic?
try this code
If you found this answer helpful then please mark it as best answer so it can help others.
Thanks
Akhsay
I tried this, getting syntax error
If you have any questions regarding your next steps, please contact the PROGRAM A admissions team in the Office of Executive Education at abc@abc.com.
or
IF PROGRAM B - Display this text:
If you have any questions regarding your next steps, please contact the PROGRAM B admissions team in the Office of Executive Education at 123@abc.com.
Here program name display from field in SF record, I need put static Email here.
Please use this in your code for if condition.
I hope you understand this.
<apex:page>
<apex:variable value="showSecond" var="myVar" />
<apex:outputlink rendered="{!myVar=='showFirst'}" >I am FIRST link</apex:outputlink>
<br/>
<apex:outputlink rendered="{!myVar=='showSecond'}" >I am SECOND link</apex:outputlink>
<apex:page>
Please mark it as best Answer if you find it helpful.
Thank You
Ajay Dubedi