Sc_field_display does not show if any other validate command

In scriptinit I have sc_field_display({myfield},off);
In validate (or validatesuccess) I have sc_field_display({myfield},on); followed by some things to do. It does not process the field ON until after everything else in validate has run.

Is there a reason for this? Shouldn’t it process in order listed?

Hi,

The sequence is like you described. onValidateSuccess only execute if everything is ok in onValidate. The same happens with onValidateFailure.

If in onValidate there is some error, so onValidateSuccess won’t be executed, but onValidateFailure instead.

But that is exactly what is not happening.

INVALIDATE has sc_field_display({myfield},on);
INVALIDATESUCCESS has do this and do that.

It NEVER displays myfield (invalidate) until after it does everything in invalidatesuccess (some php and then a call to a stored proc mysql).

WHY?

Can you show us your code in onValidate and onValidateSuccess?

onvalidate
sc_field_display({working},on);

onvalidatesuccess
sc_lookup(rs,“select direct from defdirs”);
$ndir={rs[0][0]};

$files = glob($ndir.’//*.txt’); // get all file names
foreach($files as $file){ // iterate files
if(is_file($file)) {
unlink($file); // delete file
}
}

dotestpull();

Have you checked if the code in onValidateSuccess is working correctly?

If I remove everything from ONVALIDATESUCCESS it shows perfectly. There must be some way to trick it into doing this. I am thinking it has to do with redrawing the screen and won’t do that until all the validation done. This should be straightforward but…