Forums

Access form data before posting back

AnrietteC 07 Jan, 2014
Hi there

I need to access form data before it gets posted back, in other words, I have hidden fields on my form with values that I need to access before the Show HTML action gets called in On Load.

I have made a Custom Code action before Show HTML, but
$form->data['hidden_variable']
returns
NULL


Any ideas?

Thanks in advance.

// edit: This is for Joomla! 3.0 and CF v4
AnrietteC 07 Jan, 2014
I want to get the form values generated by Chronoforms before the submit button gets clicked.

I need the form values in order to generate an md5() signature of all the form values.

Is there some other Joomla 3.0 default way to get the form values on the page during On Load?
GreyHead 07 Jan, 2014
Hi AnrietteC,

This does not make sense to me. Where do the values for the hidden inputs come form. If you are adding them before the form loads then you have the data to calculate an MD5; if they are being added in the browser then they don't exist when the form loads and you'd need to calculate with JavaScript.

In general it's safer to pass data like this in the User session instead of using hidden inputs.

Bob
AnrietteC 09 Jan, 2014
Hi Bob

I added the values for each input in the Elements tab, on each element's lightbox value textbox. I don't understand why it doesn't come through on the
$form->data
array.
Max_admin 09 Jan, 2014
Hi AnrietteC,

Yes, if you added them using the element settings then you can't capture them using PHP, but if they are static then you can just pass them to your MD5 function in static array or something ?

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.