Client Script API

Mushir
Giga Guru

why g_form.isMandatory is not working in onLoad client script? but it's working fine on onSubmit client script

1 ACCEPTED SOLUTION

Uncle Rob
Kilo Patron

Its because of the order of execution.  On Load client scripts will run before things like UI Policies run.
isMandatory() returns true if the field in question is mandatory, but there's lots of stuff AFTER an On Load client script that could influence that.  
It's only on On Submit where everything is stable and known enough for a script to properly judge isMandatory().

View solution in original post

1 REPLY 1

Uncle Rob
Kilo Patron

Its because of the order of execution.  On Load client scripts will run before things like UI Policies run.
isMandatory() returns true if the field in question is mandatory, but there's lots of stuff AFTER an On Load client script that could influence that.  
It's only on On Submit where everything is stable and known enough for a script to properly judge isMandatory().