{!REQUIRESCRIPT("/soap/ajax/33.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/33.0/apex.js")}
var rcn = "{!Opportunity.Description__c}";
var amt = "{!Opportunity.Amount}";
if( rcn!= '' && amt!= '' && amt!= '0.00')
{
window.open("{!URLFOR( $Action.Opportunity.Submit, Opportunity.Id )}");
}
else if (amt=='' || amt =='0.00')
{
alert("Enter Amount");
}
else if (rcn=='')
{
alert("Enter Description");
}
else
{
alert("Enter Amount and Description");
}
Here my target is that I should be able to submit an opportunity for approval only if Amount and Description are entered. Else it should throw errors separately is any of those fields is null/zero. This code is alowing me to submit even though Amount is null and also Description is null.