We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 54700
    • 1 Posts
    Hi,

    I have inherited a site on modx, ive managed to update it fully to the latest evolution version without issue but we have been recently inundated with spam.

    I have tried to follow the instructions here: http://www.evolution-docs.com/tutorials/extras-how-to/formlister-tutorials/basic-contact-form-with-recaptcha

    Without the captcha the form submits perfectly fine. When i enable the captcha i get the error A reCAPTCHA validation error occured from the call.

    Can someone please assist in solving this issue?

    my code is

      [!FormLister?
    &formid=`contactform`
    &rules=`
    {
        "name":
        {
            "required": "Be sure to enter a name"
        },
        "email":
        {
            "required": "Be sure to enter email",
            "email": "Enter email correctly"
        },
    	"message": {
    		"required": "Please enter a message"
       
    }`
    &to=`email@email`
    &fromName=`My Company`
    &replyTo=`email@email`
    
    &captcha=`reCaptcha`
    &captchaParams=`{
        "siteKey":"xxxxxxx",
        "secretKey":"xxxxx",
        "errorCodeFailed":"A reCAPTCHA validation error occured",
        "theme":"light"
    }`
    &captchaField=`g-recaptcha-response`
    
    &subject=`Contact form submission from [*pagetitle*]`
    &reportTpl=`ContactCodeTpl`
    &formTpl=`@CODE:
     <div class="half">
                            <h2>Contact Us</h2>
                            <form class="form-horizontal" method="post">
                                <input type="hidden" name="formid" value="contactform">
                                <ul>
                                    <li class="[+name.errorClass+] [+name.requiredClass+]">
                                        <span class="lbl">Name:</span>
                                        <input type="text" id="name" placeholder="Name" name="name" value="[+name.value+]" autocomplete="none">
    									 <div class="clear"></div>
                                    </li>
    							
    								
                                    <li class="[+company.errorClass+] [+company.requiredClass+]">
                                        <span class="lbl">Company:</span>
                                        <input type="text" id="company" name="company" value="[+company.value+]" autocomplete="none">
    									 <div class="clear"></div>
                                    </li>
                                    <li class="[+email.errorClass+] [+email.requiredClass+]">
                                        <span class="lbl">Email:</span>
                                        <input type="text" id="email" placeholder="Email" name="email" value="[+email.value+]" autocomplete="none">
    									 <div class="clear"></div>
                                    </li>
                                </ul>
                        </div>
                        <div class="half">
                            <ul class="pad-down">
                                <li class="[+message.errorClass+] [+message.requiredClass+]">
                                    <span class="lbl full">Message:</span>
                                    <textarea id="message" placeholder="Your message" name="message"> </textarea>
                                        [+form.messages+]
    								
    								
                                </li>
    							
    							<!-- reCAPTCHA -->
    [+captcha+]
    							
                                <li>
                                   <button type="submit">Send</button>
                                </li>
                            </ul>
                        </div>
                </form>
              `
    &messagesTpl=`@CODE:<div class="form-group"><div class="col-sm-offset-2 col-sm-10">[+required+][+errors+][+messages+]</div></div>`
    &messagesRequiredOuterTpl=`@CODE:<div class="panel panel-warning"><div class="panel-heading"><i class="glyphicon glyphicon-alert"></i>You did not fill in the required fields</div><div class="panel-body">[+messages+]</div></div>`
    &messagesErrorOuterTpl=`@CODE:<div class="panel panel-danger"><div class="panel-heading"><i class="glyphicon glyphicon-alert"></i>Some fields are invalid </div><div class="panel-body">[+messages+]</div></div>`
    &messagesOuterTpl=`@CODE:<div class="panel panel-default"><div class="panel-heading"></div><div class="panel-body">[+messages+]</div></div>`
    &errorClass=` has-error`
    &requiredClass=` has-warning`
    &errorTpl=`@CODE:<span class="help-block">[+message+]</span>`
    !]