Checkbox in emailForm.php

3 posts by 2 authors in: Forums > CMS Builder
Last Post: July 16, 2013   (RSS)

By Toledoh - July 15, 2013

Hi Guys,

I'm using the standard emailForm.php, but trying to add checkboxes using the following:

    <input type = "checkbox" name = "director" value = "1" <?php checkedIf(1, @$_REQUEST['director']);?> />Directors’ guideline:<br />
    <input type = "checkbox" name = "trustee" value = "1" <?php checkedIf(1, @$_REQUEST['trustee']);?> />Trustees’ guideline: <br />
    <input type = "checkbox" name = "business" value = "1" <?php checkedIf(1, @$_REQUEST['business']);?> />Business owners’ guideline<br />
    <input type = "checkbox" name = "all" value = "1" <?php checkedIf(1, @$_REQUEST['all']);?> />All guideline

then, when sending the email I use:

Director:  {$_REQUEST['director']}
Trustee:  {$_REQUEST['trustee']}
Business:  {$_REQUEST['business']}
All:  {$_REQUEST['all']}

which works if the check box is ticked, but returns an error if the check box is left unticked.. "Undefined index: director....."

Any thoughts?

Cheers,

Tim (toledoh.com.au)

By Toledoh - July 16, 2013

perfect - thanks Greg!

Cheers,

Tim (toledoh.com.au)