alisamii
Member
Hi
I am using a PHP plugin on OnAfterProcess to populate another table in the database. It needs to be able to access the label element of the dropdown, but I am only able to access the value element of the dropdown. I have tried using:
The $organisation_label is always blank and looking in the array this is because it only contains the value.
I have even tried creating a hidden element and updating it with the data selected in the dropdown and posting that to my table, but that is also blank.
For example the label I am trying to access is - "Organisation for Economic Co-operation and Development (OECD), France" and the value is - "oecd-france"
Thanks
Ali
I am using a PHP plugin on OnAfterProcess to populate another table in the database. It needs to be able to access the label element of the dropdown, but I am only able to access the value element of the dropdown. I have tried using:
PHP:
$organisation_label = $formModel->formData['organisation'];
$organisation_value = $formModel->formData['organisation_raw'][0];
The $organisation_label is always blank and looking in the array this is because it only contains the value.
I have even tried creating a hidden element and updating it with the data selected in the dropdown and posting that to my table, but that is also blank.
For example the label I am trying to access is - "Organisation for Economic Co-operation and Development (OECD), France" and the value is - "oecd-france"
Thanks
Ali