Doesn't work on custom form
-
Hi, the plugin displays fine when added to a custom form using the php as suggested in the readme.
However, filling it out or not doesn’t make a difference, the form still sends. I have some custom required fields, what do I need to add to make the captcha challenge the user input? Code is below (site is dev so not live)
<form id="transportmedia_contact2" method="post" action="/_quickcontact.php"> <div class="frametop_home"></div><!-- end frametop_home--> <div class="frame_home line12"><h3>Contact us</h3><br /> <p>Please fill out this form and one of our consultants will contact you as soon as possible. <span class="required">*</span> indicates a required field</p> <?php if ($_GET[Error] == "Data") { echo '<p class="smallerror">Please verify your data below. Thanks.</p>' ; } if ($_GET[NameFormatError] == "100") { echo '<p class="smallerror">Invalid name.</p>' ; $redClass_name = " redFormField"; } if ($_GET[EmailFormatError] == "100") { echo '<p class="smallerror">Invalid email.</p>' ; $redClass_email = " redFormField"; } if ($_GET[PhoneFormatError] == "100") { echo '<p class="smallerror">Invalid phone number.</p>' ; $redClass_phone = " redFormField"; } if ($_GET[CompanyFormatError] == "100") { echo '<p class="smallerror">Invalid company name.</p>' ; $redClass_company = " redFormField"; } if ($_GET[agreementOptionError] == "100") { echo '<p class="smallerror">Please accept the site terms.</p>' ; $redClass_terms = " redFormField"; } ?> <div class="sideform"> <div class="form_div"> <label for="c_media">Media</label> <input type="text" name="c_media" id="c_media" value="<?php print $_GET[c_media] ; ?>" class="formstd" /> </div> <div class="form_div"> <label for="c_loc">Target Area</label> <input type="text" name="c_loc" id="c_loc" value="<?php print $_GET[c_loc] ; ?>" class="formstd" /> </div> <div class="form_div"> <label for="e_name">Name *</label> <input type="text" name="e_name" id="e_name" value="<?php print $_GET[e_name] ; ?>" class="formstd<?php print $redClass_name ; ?>" /> </div> <div class="form_div"> <label for="e_email">Email *</label> <small>Due to the large volume of enquiries we receive, we recommend you use a company email rather than a web provided email address.</small> <input type="e_email" name="e_email" id="e_email" value="<?php print $_GET[e_email] ; ?>" class="formstd<?php print $redClass_email ; ?>" /> </div> <div class="form_div"> <label for="e_phone">Phone *</label> <input type="text" name="e_phone" id="e_phone" value="<?php print $_GET[e_phone] ; ?>" class="formstd<?php print $redClass_phone ; ?>" /> </div> <div class="form_div"> <label for="e_company">Company *</label> <input type="text" name="e_company" id="e_company" value="<?php print $_GET[e_company] ; ?>" class="formstd<?php print $redClass_company ; ?>" /> </div> <p>Please note: If you are a student or researcher we cannot offer information regarding advertising. Please contact the <a href="https://www.cim.co.uk/Home.aspx" target="_blank">Chartered Institute of Marketing.</a></p> <hr> <div class="form_div"> <fieldset> <?php if( function_exists( 'cptch_check_custom_form' ) && cptch_check_custom_form() !== true ) echo "Please complete the CAPTCHA." ?><br /> <?php if( function_exists( 'cptch_display_captcha_custom' ) ) { echo "<input type='hidden' name='cntctfrm_contact_action' value='true' />"; echo cptch_display_captcha_custom(); } ?> </fieldset> </div> <div class="form_div"> <fieldset> <input type="checkbox" id="fields_agree_terms" name="fields_agree_terms" value="I Agree" class="<?php print $redClass_terms ; ?>" /> <label><span class="required">*</span>?I accept the site <a href="/terms-conditions">terms</a> & <a href="/privacy-policy">privacy policy</a></label> </fieldset> </div> <div class="form_div"> <input type="submit" name="Submit" value="Submit"> </div> <div class="form_div"><input type="hidden" name="getsection" value="<?php echo $_SERVER['REQUEST_URI'] ; ?>" /></div> <div class="form_div"><input type="hidden" name="getthispage" value="<?php echo $_SERVER['REQUEST_URI'] ; ?>" /></div> </div> </div><!-- end of frame_home line12 --> <div class="framebtm_home"></div><!--end framebtm_home contactform--> </form>
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘Doesn't work on custom form’ is closed to new replies.