You need to sign in to do that
Don't have an account?

App name in visualforce
Hi,
I have to change my visualforce code based on the app. If there a way to write if function without using any apex command?
Is there a better way to write the logic?
The below line gives app name.
var myappname = document.getElementById("tsidLabel").innerText;
<apex:page>
<script>
function getAppName(){
var myappname = document.getElementById("tsidLabel").innerText;
}
</script>
if(myappname =='Student")
<apex:commandbutton id="test" value="Test"/>
elseif(myappname =="Employee")
<apex:Label id="lbl" value="Label">
else
<apex:inputfield id="input" value="Input">
</apex:page>
I have to change my visualforce code based on the app. If there a way to write if function without using any apex command?
Is there a better way to write the logic?
The below line gives app name.
var myappname = document.getElementById("tsidLabel").innerText;
<apex:page>
<script>
function getAppName(){
var myappname = document.getElementById("tsidLabel").innerText;
}
</script>
if(myappname =='Student")
<apex:commandbutton id="test" value="Test"/>
elseif(myappname =="Employee")
<apex:Label id="lbl" value="Label">
else
<apex:inputfield id="input" value="Input">
</apex:page>