I am having some difficulties with hiding fields on Add and Edit pages in v10. I have converted my application from v9, it is a simple order application where ordering a widget requires the record to list the components that make up the widget, this is done by autofill. The autofilled fields are included on the Add and Edit pages but are hidden on the pages by the JS Onload event.
In v9 I have used the Lookup wizard on the Item ordered field and configured the Autofill to populate the component fields, then in the JS Onload I have the following code
// Hide fields that are not relevent to the user
$("tr[data-fieldname='single_adult']").hide();
$("tr[data-fieldname='add_adult']").hide();
$("tr[data-fieldname='single_child']").hide();
$("tr[data-fieldname='add_child']").hide();
I can no longer remember where I got this code from, as I can't find it any of the xlinesoft documentation for PHPRunner, and I certainly don't know enough JS to have invented it myself. However it all works as intended. The hidden fields are autofilled and saved in the record in the table.
In v10 with Bootstrap the above code doesn't hide the fields, what does hide the fields is this code:
// Hide fields that are not relevent to the user
pageObj.hideField("single_adult");
pageObj.hideField("add_adult");
pageObj.hideField("single_child");
pageObj.hideField("add_child");
This is exactly as shown in the manual, so quite happy with that.
The problem is that when the fields are hidden then the autofilled values are not saved, if I disable the hide then the fields are autofilled and saved as expected.
Anyone any ideas what I may be doing wrong in v1o?