+ Start a Discussion
razzazrazzaz 

Disable Close button based on a field Please help

Ok I really do not know that much about buttons on salesforce.. actually a newbie but was wondering if anyone has ever disable a button based on a case field...
for example, when a user views a case and the case reason is 'delivery issue", the close button would be disable or not there for them ...i started writing the code but do not know what is the api or object name for buttons on a case....
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<script type="text/javascript" language="javascript" src="/js/functions.js"></script>
<script type="text/javascript" language="javascript" src="/soap/ajax/11.1/connection.js"></script>
<script type="text/javascript" language="javascript" src="/js/dojo/0.4.1/dojo.js"></script>
<script>
 
function init() {
var cReason = "{!Case.Reason}";
if (cReason=="Delivery Issues")
{
//Disable the Close button
}
else
{
//do Nothing
}
</script>
 
Please help... thanks
shan876shan876

ok so my code so far is: but does anyone know the code for like the close button on a case... the regular link it goes to???

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<script type="text/javascript" language="javascript" src="/js/functions.js"></script>
<script type="text/javascript" language="javascript" src="/soap/ajax/11.1/connection.js"></script>
<script>



function init() {
//var cReason = "{!Case.Reason}";
cReason="Delivery Issues";
if (cReason=="Delivery Issues")
{
//Disable the Close button
alert("Can not do")
}
else
{
//do Nothing
}
}
</script>
</head>
<body>
<form>
<INPUT TYPE="button" NAME="myButton" VALUE="Close" onClick="init();">
</form>
</body>
</html>