Hi,
Is it possible to use this module on a custom form (I am not using the Drupal Form API or webform module)? I have a D7 site that has a node/content page with the following code:
<form id="signup_form" action="[form action]" method="post" enctype="application/x-www-form-urlencoded">
<div>
<input id="firstName" tabindex="1" type="text" name="firstName" placeholder="First Name" value="" maxlength="100" class="name-icon" required />
<label for="firstName">First Name* </label>
</div>
<div>
<input id="lastName" tabindex="2" type="text" name="lastName" placeholder="Last Name" value="" maxlength="100" class="name-icon" required />
<label for="lastName">Last Name* </label>
</div>
<div>
<input id="email" tabindex="3" type="text" name="email" placeholder="Email" value="" maxlength="254" class="email-icon" />
<label for="email">Email* </label>
</div>
<div>
<input id="name" tabindex="4" type="text" name="name" placeholder="Company Name" value="" maxlength="100" class="company-icon" />
<label for="name">Company Name* </label>
</div>
<div>
<input id="phone" tabindex="5" type="text" name="phone" placeholder="Phone" value="" maxlength="40" class="phone-icon" />
<label for="phone">Phone </label>
</div>
<input type="hidden" name="form_id" value="signup_form" />
<div>
<input id="btn-submit" tabindex="6" class="submit" type="submit" name="submitButton" value="SIGN UP" />
</div>
</form>
I received a security requirement on our sign up form (Drupal 7 site), to have reCAPTCHA displayed at the bottom of the page when there has been an X number of form submissions from the same IP address in a given amount of time. I was hoping CAPTCHA After could work for my custom form -- I tested it on our site's Admin Login page (/user) and it worked great, of course.
I can't seem to get any CAPTCHA displaying on my custom form page. In the General Settings, I selected "Add CAPTCHA administration links to forms" and a drop-down with "CAPTCHA: CHALLENGE "RECAPTCHA" ENABLED" displayed in the content page where the form is coded.
I just learned that the HTML id has nothing to do with $form_id... I referenced this Drupal Stack Exchange page, and haven't been able to generate the form ID...I'm wondering maybe my custom HTML form doesn't have a $form_id because it doesn't use any drupal form modules. If that's the case, then I probably can't use the CAPTCHA module. Could someone please confirm?
Any guidance would be great. Thank you!
Comments
Comment #1
ForTheWin CreditAttribution: ForTheWin commentedComment #2
ForTheWin CreditAttribution: ForTheWin commentedComment #3
wundo CreditAttribution: wundo commentedWhy would you create a form without the Form API?
Comment #4
ForTheWin CreditAttribution: ForTheWin commentedHi @wundo,
Thanks for responding. We need to do all sorts of A/B testing on our form (process and changing input fields) via Optimizely, so creating a custom form would probably be easiest. Please let me know your thoughts.
Comment #5
hass CreditAttribution: hass commentedDrupal requires form api and a/b testing does not change this. Try using webform.