首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >ExpressionEngine SafeCracker表单不提交,只是刷新页面

ExpressionEngine SafeCracker表单不提交,只是刷新页面
EN

Stack Overflow用户
提问于 2011-09-16 20:52:23
回答 1查看 1.1K关注 0票数 1

我有以下联系人表单,但当我按要求填写了所有字段后,该表单似乎没有提交。页面只是刷新以显示填充了数据的相同表单。

代码语言:javascript
复制
{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</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}

我想知道有没有人能帮我解决这个问题。这很可能是非常明显的事情。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2011-09-16 22:58:33

尝试删除error_handling="inline" parameter,这将允许您查看SafeCracker通过User Message Templates呈现给您的实际错误消息。

在查看代码时,您的SafeCracker表单似乎缺少标题{title}字段,我认为SafeCracker需要该字段-要么通过隐藏输入,要么由用户提供。

要对SafeCracker表单进行故障排除,请执行以下操作:

删除Entry Title Field {title}的错误处理

执行此操作将允许您:

请参阅the Error Message

  • Submit Entry to ExpressionEngine

  • 的完整错误

一旦一切正常,您就可以将错误处理参数改回内联。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/7444942

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档