开发者

ExpressionEngine SafeCracker Form Does Not Submit and Simply Refreshes Page

I have the following contact form, but it does not seem to be submitting when I have completed all of the fields as required. The page just refreshes to show the same form with the data filled in.

{exp:safecracker channel="contact_us" id="form-contact" return="contact-us/thanks" datepicker="no" error_handling="inline" include_jquery="no" rules:cf_contact_us_email="valid_email"}
    <fieldset>
        <legend>Your contact details&开发者_JAVA技巧lt;/legend>

        <ul>
            <li><label>{label:cf_contact_us_title}</label>{field:cf_contact_us_title}{if required} *{/if}</li>
            {if error:cf_contact_us_title}<li class="error">{error:cf_contact_us_title}</li>{/if}

            <li><label>{label:cf_contact_us_name}</label>{field:cf_contact_us_name}{if required} *{/if}</li>
            {if error:cf_contact_us_name}<li class="error">{error:cf_contact_us_name}</li>{/if}

            <li><label>{label:cf_contact_us_address}</label>{field:cf_contact_us_address}{if required} *{/if}</li>
            {if error:cf_contact_us_address}<li class="error">{error:cf_contact_us_address}</li>{/if}

            <li><label>{label:cf_contact_us_towncity}</label>{field:cf_contact_us_towncity}{if required} *{/if}</li>
            {if error:cf_contact_us_towncity}<li class="error">{error:cf_contact_us_towncity}</li>{/if}

            <li><label>{label:cf_contact_us_postcode}</label>{field:cf_contact_us_postcode}{if required} *{/if}</li>
            {if error:cf_contact_us_postcode}<li class="error">{error:cf_contact_us_postcode}</li>{/if}

            <li><label>{label:cf_contact_us_telephone}</label>{field:cf_contact_us_telephone}{if required} *{/if}</li>
            {if error:cf_contact_us_telephone}<li class="error">{error:cf_contact_us_telephone}</li>{/if}

            <li><label>{label:cf_contact_us_email}</label>{field:cf_contact_us_email}{if required} *{/if}</li>
            {if error:cf_contact_us_email}<li class="error">{error:cf_contact_us_email}</li>{/if}

            <li class="inset"><label>{label:cf_contact_us_method}</label></li>
            <li>{field:cf_contact_us_method}{if required} *{/if}<br>{error:cf_contact_us_method}</li>
            {if error:cf_contact_us_method}<li class="error">{error:cf_contact_us_method}</li>{/if}

            <li><label>{label:cf_contact_us_enquiry}</label>{field:cf_contact_us_enquiry}{if required} *{/if}</li>
            {if error:cf_contact_us_enquiry}<li class="error">{error:cf_contact_us_enquiry}</li>{/if}

            <li class="checkbox-first">{field:cf_contact_us_terms} <a href="{site_url}/terms}">Terms and Conditions</a>{if required} *{/if}</li>
            {if error:cf_contact_us_terms}<li class="error">{error:cf_contact_us_terms}</li>{/if}

            <span class="clearfix"></span>
            <li class="form-button"><input type="submit" class="submit rounded" name="send" value="Send" /></li>
        </ul>
    </fieldset>
{/exp:safecracker}

I wondered if anyone might be able to help me figure this out. It’s likely something incredibly obvious.


Try removing the error_handling="inline" parameter, which will allow you to see the actual error message(s) SafeCracker is presenting to you thru the User Message Templates.

In looking over your code, your SafeCracker form seems to be missing the Title {title} field, which I believe is required by SafeCracker — either thru a hidden input or supplied by the user.

To troubleshoot your SafeCracker form:

  1. Remove the Error Handling Parameter
  2. Include the Entry Title Field {title}

Doing this will allow you to:

  • See the Full Error Message
  • Submit the Entry to ExpressionEngine

Once you have everything working, you can change the error handling parameter back to inline.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜