onLoad() function call within onChange() - Client script

Anish Reghu
Kilo Sage
Kilo Sage

Dear experts,

Is the following possible in one single onChange client script? I understand, we can have the onLoad as a separate client script.

Task 1 - Validate some values of a checkbox to be true or false on load of a form and apply logic.

Task 2 - proceed next into onChange validation and logic.

Example:

function onLoad()

{

//executes first

}

function onChange(parameters)

{

//executes next

}

 

Regards,

Anish

1 ACCEPTED SOLUTION

Saiganeshraja
Kilo Sage
Kilo Sage
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
   //If the form is loading or the new value of the changing field is empty exit the script
   if (isLoading || newValue == '') {

/// Write your onload logic here
      return;    }
On change logic under it .

Mark correct and helpful.

View solution in original post

5 REPLIES 5

Sometimes, what is known becomes a question mark.

Although one can see that it is a OR condition, I was always reading it along (AND) with isLoading condition and learned it the hard way, that I am stuck with a wrong thinking and I should have had one more tea!

 

Cheers mate!

Anish