OnValidate issue when clicking ADD only

I have version 7.01.0015.

I have written a simple onvalidate check like this.

if(({jobqual} == ‘Hired’ or {jobqual} == ‘Disqualified’) and sc_date_empty({date_to_hr})){
sc_error_message(“Because the Applicant was “.{jobqual}.”, you must supply a date returned to HR!”);
sc_set_focus(‘date_to_hr’);
}

If I fulfill the logic above by selecting Hired or Disqualified and leaving the date_to_hr field empty and CLICK the ADD button, I get the
ajax pop as expected, but it immediately (can’t even read it) goes away and fails to focus on the date_to_hr field.

I finally got a screen shot of the ajax box as it pops up… It says

Error
Because the Applicant was Hired, you must supply a date returned to HR!
Along with a Yellow Bang!

(and)

Script: (long path) orm_applications_apl.php(1099)

NOW if I choose another status other than hired or disqualified which then allows me to have the record recorded into the DB all is well.
If I then go and edit the record and change the status back to either Hired or Disqualified and leave the date_to_hr blank and CLICK the SAVE Button…
This time the ajax box pops with…

Error
Because the Applicant was Hired, you must supply a date returned to HR!
Along with a Yellow Bang!

and the focus goes to the date_to_hr field as it is supposed to. There is no further error message with a line number to the php code at 1099 either.

so in summary, the onvalidate has an issue staying on the screen or focusing on the field if I choose ADD when adding a brand new record but works when I SAVE
a previously inserted record that has been edited.

Richard
aka Nacman

fail.JPG

Correct.JPG

Hello,

Issue reported to our bugs team.

regards,
Bernhard