How do I add a check box to the WSM Registration form?

4 posts by 2 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: May 29, 2012   (RSS)

Re: [Perchpole] How do I add a check box to the WSM Registration form?

By Perchpole - May 28, 2012

I did this...

<input type="checkbox" name="compliance" value="1" />

...and this...

if (@$_REQUEST['compliance']!='1') { $errorsAndAlerts .= "You must agree to abide by our Terms & Conditions!<br/>\n"; }

I don't know if it's right but it appears to work now.

Is there a better solution?

Perch

Re: [Perchpole] How do I add a check box to the WSM Registration form?

By Jason - May 29, 2012

Hi Perch,

Your second solution is fine. It can also be written as:

if (!@$_REQUEST['compliance']) { .. }

The reason this didn't work the first time was the value you were giving your check box was the current value of @$_REQUEST['compliance']. When you go to the page, this value is empty, so your check was failing regardless of whether they checked the box or not.

Hope this helps
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] How do I add a check box to the WSM Registration form?

By Perchpole - May 29, 2012

A-ha!

Thanks Jason.

:0)

Perch