自定义联系表单:无法提交您的请求。请稍后再试

时间:2016-03-21 13:18:22

标签: php magento

我在:

中创建了一个新的联系表单
app/design/frontend/base/default/template/contacts

命名为form2.phtml

我收到错误:无法提交您的请求。请稍后再试。

这是我的代码:

            <div id="messages_product_view"><?php echo $this->getMessagesBlock()->toHtml() ?></div>
            <h2>Questions? Comments?<br>
            Contact us here and we’ll get back to you shortly.</h2>
            <form action="<?php echo $this->getFormAction(); ?>" id="contactForm2" class="footer-form" method="post">
                <div class="fieldset">

                    <ul class="form-list">
                        <div class="form-row">
                            <li>
                                <div class="input-box">
                                    <input placeholder="First Name *" name="first name" id="name" title="<?php echo Mage::helper('core')->quoteEscape(Mage::helper('contacts')->__('First Name')) ?>" value="<?php echo $this->escapeHtml($this->helper('contacts')->getUserName()) ?>" class="input-text required-entry" type="text" />
                                </div>
                            </li>
                                        <li>
                                <div class="input-box">
                                    <input placeholder="Last Name *" name="last name" id="name" title="<?php echo Mage::helper('core')->quoteEscape(Mage::helper('contacts')->__('Last Name')) ?>" value="<?php echo $this->escapeHtml($this->helper('contacts')->getUserName()) ?>" class="input-text required-entry" type="text" />
                                </div>
                            </li>
                        </div>
                        <div class="form-row">
                            <li>
                                <div class="input-box">
                                    <input placeholder="Email *" name="email" id="email" title="<?php echo Mage::helper('core')->quoteEscape(Mage::helper('contacts')->__('Email')) ?>" value="<?php echo $this->escapeHtml($this->helper('contacts')->getUserEmail()) ?>" class="input-text required-entry validate-email" type="text" />
                                </div>
                            </li>
                            <li>
                                <div class="input-box">
                                    <input placeholder="Telephone" name="telephone" id="telephone" title="<?php echo Mage::helper('core')->quoteEscape(Mage::helper('contacts')->__('Telephone')) ?>" value="" class="input-text" type="text" />
                                </div>
                            </li>
                        </div>
                        <li class="wide">
                            <div class="input-box">
                                <textarea placeholder="Message *" name="comment" id="comment" title="<?php echo Mage::helper('core')->quoteEscape(Mage::helper('contacts')->__('Comment')) ?>" class="required-entry input-text" cols="5" rows="3"></textarea>
                            </div>
                        </li>
                    </ul>
                </div>
                <div class="buttons-set">
                    <input type="text" name="hideit" id="hideit" value="" style="display:none !important;" />
                    <button type="submit" title="<?php echo Mage::helper('core')->quoteEscape(Mage::helper('contacts')->__('Submit')) ?>" class="button"><span><span><?php echo Mage::helper('contacts')->__('SEND') ?></span></span></button>
                </div>
            </form>
            <script type="text/javascript">
            //<![CDATA[
                var contactForm = new VarienForm('contactForm', true);
            //]]>
            </script>

任何想法会导致什么?当我将其切换回默认表单时,默认表单正常工作。我错过了某个地方的一步吗?

由于

1 个答案:

答案 0 :(得分:0)

因为你有&#34; hideit&#34;输入已添加,已注释掉

if (Zend_Validate::is(trim($post[’hideit’]), ‘NotEmpty’)) { 
    $error = true; 
}

在app / code / core / Mage / contacts / controllers / indexController.php里面