Forums

precheck checkbox from link

jrthor2 06 Jan, 2014
If I have a banner that links to a form, that has checkboxes on it, is it possible to link to the form page, passing something in the url that would check the appropriate checkbox that I want checked when the page loads?

Thanks!!
GreyHead 06 Jan, 2014
HI jrthor2,

You can add a parameter to the banner URL like &bid=999. ChronoForms will automatically add that to the $form->data array in the form On Load event so you can then use it to set a checkbox value.

Bob
jrthor2 06 Jan, 2014
and how would I set it to checked then?? What is bid=999?

Thanks
GreyHead 06 Jan, 2014
Hi jrthor2,

&bid=99 is some parameter that you add to the banner URL = it could be anything that suits your needs.

In the form ON Load event $form->data['bid'] will be set to 999 so can then use PHP to set a value for the checkbox you want enabled.

Bob
jrthor2 07 Jan, 2014
So, I gather in the wizard editor, in the Event On Load section, I need to add a Custom Code Core Action? Any chance I could get some custom code help?? :-)

Thanks!
GreyHead 07 Jan, 2014
PS But it will be different if you have a checkbox group rather than single checkboxes. If you want useful code then you need to ask specific questions with information about your form.
jrthor2 08 Jan, 2014
Yup, you're right, and it is a checkbox group? :-(

Any help is greatly appreciated!!

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