Disabled Form Values are sent

Hello,

I have a question (actually, it’s a point i have been stuck with for several days) regarding disabled DynamicForm

For example, the ‘FormSplitting’ example : http://www.smartclient.com/index.jsp#formSplitting

If I set one of the forms to be disabled, for example ‘form0’

<ValuesManager ID="vm"/>

<VLayout width="400" height="300" membersMargin="10">
    <members>
        <TabSet ID="theTabs" height="250">
            <tabs>
                <tab title="Item">
                    <pane>
                        <DynamicForm ID="form0" valuesManager="vm" disabled="true">
                            <fields>
                                <field name="itemName" type="text" title="Item"/>
                                <field name="description" type="textArea" title="Description"/>
                                <field name="price" type="float" title="Price" defaultValue="low"/>
                            </fields>
                        </DynamicForm>
                    </pane>
                </tab>
                <tab title="Stock">
                    <pane>
                        <DynamicForm ID="form1" valuesManager="vm">
                            <fields>
                                <field name="inStock" type="checkbox" title="In Stock"/>
                                <field name="nextShipment" type="date" title="Next Shipment"
                                       useTextField="true" defaultValue="256"/>
                            </fields>
                        </DynamicForm>
                    </pane>
                </tab>
            </tabs>
        </TabSet>
    
        <Button title="Submit">
            <click>
                vm.validate();
                if (form1.hasErrors()) theTabs.selectTab(1);
                else theTabs.selectTab(0);
            </click>
        </Button>
    </members>
</VLayout>

The DynamicForm0 is still being validated and it’s values sent to the server (or are there when i do a

vm.getValues ()

) even when it’s disabled. Which surprised me since in HTML, the values of a form are not sent when it is disabled.
Is there a way to prevent the validation and the values being sent to the server ?

I tried many methods to find a turnaround without having to generate a “gas factory” but none yielded the required result.

Thank you

Hi Gli,
This is actually something of a feature of dynamicForms over plain HTML forms.

We support validating and submitting values from disabled forms / items, or even values with no explicitly declared form items at all (no need for developers to specify hidden HTML items to submit values to the server).

Anyway to avoid getting / submitting values from a specific, disabled form as part of the valuesManager we’d recommend you simply call valuesManager.removeMember() at the same time as disabling the form [and ‘addMember()’ to re-enable it].