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)

By Perchpole - May 28, 2012

Hello, All -

The title of this post really says it all. I want to add a checkbox to the registration form which users must activate to demonstrate their compliance with the terms & Conditions of the site.

I simply copied one of the other lines of code and changed the input type to checkbox...

<input type="checkbox" name="compliance" value="<?php echo htmlspecialchars(@$_REQUEST['compliance']); ?>" />

...then added a new line to the error checking code...

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

...but none of this seems to work.

The code does not seem to recognise when the box has been checked - which in turn generates an error message.

:0/

Perch

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: [Jason] How do I add a check box to the WSM Registration form?

By Perchpole - May 29, 2012

A-ha!

Thanks Jason.

:0)

Perch