1

I need to get the values of fields when the form is saved by any of the save buttons. So far I only get an empty array.

Working with a custom field for Mosets Tree component. I used what I expected would grab the field values as an array on submission.

$data = JFactory::getApplication()->input->post->getArray();

HTML fields

<form action="index.php" method="post" name="mtForm" id="mtForm" enctype="multipart/form-data">
<input type="number" name="amount" id="amount" value="" />
<input type="text" name="eml" id="eml" value="" />

On submit the values of "amount" and "eml" fields should be retrieved and passed to a hidden field which uses the assigned Mosets name and ID attribs for DB ID and parseValue($value) method.

<input type="hidden" name="cf56" id="cf56" value="'.$data['amount'].','.$data['eml'].'" />
</form>

Both values return null and when I test the $data var it is empty. What else is needed to get the post values?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.