Wizard / Multistep form - Unable to hide / show field using sc_field_display

Hi.

I have a multi-step form (wizard). After completing step 1 of the form, I need to be able to hide some of the fields for step 2 - these are not database fields - they were added to collect input from the user that affects processing in onAfterInsert.

As part of onValidateSuccess at the end of Step 1, I use sc_field_display to attempt to hide the fields which would be displayed in Step 2. When the form (page) for step 2 displays, the field is always present.

I have since done some testing by creating a couple of fields. I am now executing sc_field_display in both onScriptInit and onValidateSuccess. One field is defined with Hidden off, and I am attempting sc_field_display({field1},off) and it always displays the field. The other field I have turned on the Hidden attribute for the field and attempt sc_field_display({field1},on) and it never appears.

In the case of field1 when I execute sc_field_display({field1},off) I can confirm that Scriptcase is generating the code ( $this->nmgp_cmp_hidden[“field1”] = ‘off’; $this->NM_ajax_info[‘fieldDisplay’][‘field1’] = ‘off’; ) in the correct place.

I have used echo statements to verify that the sc_field_display statements are being executed, and I am seeing the text displayed.

Regardless, sc_field_display is having no affect. According to the documentation, this should work on both these events.

Does anyone have any ideas on what I am doing wrong? Or is this a bug?

Running scriptcase 9.12.23 (2).

Regards, Russell.