I have a form that allows new submissions, or editing existing submissions.
Most of it works fine.
However, I want to load data into certain fields IF it's a "new" submission.
I have 2 models, 1 for new/existing registrations, 1 for saved options
registration (model for new/existing)
savedoption (value I want to use for NEW registrations only)
For a dynamic dropdown, I found a simple solution. The dropdown is named registration.vehicle1_number
I use the "dynamic selections" and set to {var: savedoption.vehicle1_number}. It seems to default to "registration.vehicle1_number" when loading an existing form and properly populate with "savedoption.vehicle1_number" when using a new registration.
Perfect.
However, I'm having an issue with the checkboxes. I can't get them to work properly.
They're named registration.vehicle1_24ghz. I tried putting "savedoption.vehicle1_24ghz" in the checked field, and {var:savedoption.vehicle1_24ghz} and neither worked.
I tried adding a custom PHP to the "not found" on the read data action for an existing registration form.
$this->set('registration.vehicle1_24ghz','savedoption.vehicle1_24ghz') but that didn't work either.
How can I set the value on registration.vehicle1_24ghz using some sort of action?