Forums

Combine form fields into one field on submission

green_eye_boy_121 14 Apr, 2011
Hi There,

I need to combine the values of multiple fields on a form into a single hidden field in a form before it is submitted. Please can you point me in the right direction as to how to achieve this.

Thanks,
Steven
Max_admin 17 Apr, 2011
Hi,

You may do this using the Javascript onSubmit function Or through PHP code after the submission:

$new_data = JRequest::getVar('field1').JRequest::getVar('field2').JRequest::getVar('field3');
JRequest::setVar('field_new', $new_data);


Regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
amirmoshe 22 Oct, 2012
Hey MAx thank for the answer is was very helpfull!

but when i'm trying this i have another problem,
can you please help me...

i want to change the price of a product regarding to a checkbox cheked or not, and also by droplist
and the code:

JRequest::getVar('input_checkbox_5');

give the the output of the checkbox and not if it's selected or not,

how can i see if the chekbox is checked or not?
ans also how can i see witch droplist is checked?

hoe you can help me,
Thanks Regards, Amir
🙂
GreyHead 22 Oct, 2012
Hi Amir,

This is an old thread. Which version of ChronoForms are you using?

Bob
This topic is locked and no more replies can be posted.