Is there a way to send (if any) the Validation Error text to such a button, shown below? I would put it at the "Error" text at the end, if possible. I cannot find a reference to this in my searches.
{!REQUIRESCRIPT ("/soap/ajax/13.0/connection.js")}
/* THREE REFERENCE CHANGES if copying to new button */
var formid = "{!Company_Form_Opp__c.Id}";
var userid = "{!$User.Id}";
var FormToUpdate = new sforce.SObject("Company_Form_Opp__c");
var padyear = {!YEAR(TODAY())};
var padmonth = {!MONTH(TODAY())};
if( padmonth.toString().length == 1 ) { padmonth = '0'+padmonth }
var padday = {!DAY(TODAY())};
if( padday.toString().length == 1 ) { padday = '0'+padday }
if( "{!Company_Form_Opp__c.BILLCHG_Accounting_Signature__c }" != '' ) {
alert("Already signed!");
} else {
FormToUpdate.set("Id", formid);
FormToUpdate.set( "BILLCHG_Accounting_Signature__c" , userid);
FormToUpdate.set( "BILLCHG_Accounting_Signature_Date__c" , padyear + '-' + padmonth + '-'+ padday );
var Result = sforce.connection.update([FormToUpdate]);
if(Result[0].getBoolean("success")) {
function redirect() { parent.frames.location.replace("/{!Company_Form_Opp__c.Id}"); }
redirect();
} else {
alert("Error");
}
}