I use ChronoForms to edit a table with user data.
For some user I want to make it possible to edit all fields, for others only some fields.
How can I dynamically drop/delete specific fields from the form (eg delete them from the form->data[] array).
Ben.
For some user I want to make it possible to edit all fields, for others only some fields.
How can I dynamically drop/delete specific fields from the form (eg delete them from the form->data[] array).
Ben.
Hi benbeek,
You can use a Custom Code action in the form ON Load event to edit the $form->data array and unset some values. But it might be better to either hide the inputs or set them to readonly or disabled instead.
Bob
You can use a Custom Code action in the form ON Load event to edit the $form->data array and unset some values. But it might be better to either hide the inputs or set them to readonly or disabled instead.
Bob
I tried that with a php onload event before the show html, eg:
but this does not work. Field 'startdate' is still there.
So the question is (and was): how can I delete fields from the form? (or maybe disable or hide them).
Ben.
unset($form->data['startdate']) ;
but this does not work. Field 'startdate' is still there.
So the question is (and was): how can I delete fields from the form? (or maybe disable or hide them).
Ben.
This topic is locked and no more replies can be posted.