Jquery 从灯箱呼叫时,Magento中的联系我们表单不起作用
我在cms页面中调用了联系人表单,然后调用该cms页面以显示“联系我们”页面。现在,我需要在页面顶部显示一个链接,以便快速联系,从而在lightbox中打开页面。我添加了代码以在breadcrumbs.phtml文件中显示此链接。表单已加载,但尚未提交。当我点击按钮时,什么也没发生。这是我用来在div标签中显示contact-us页面的代码Jquery 从灯箱呼叫时,Magento中的联系我们表单不起作用,jquery,lightbox,form-submit,magento-1.7,contact-form,Jquery,Lightbox,Form Submit,Magento 1.7,Contact Form,我在cms页面中调用了联系人表单,然后调用该cms页面以显示“联系我们”页面。现在,我需要在页面顶部显示一个链接,以便快速联系,从而在lightbox中打开页面。我添加了代码以在breadcrumbs.phtml文件中显示此链接。表单已加载,但尚未提交。当我点击按钮时,什么也没发生。这是我用来在div标签中显示contact-us页面的代码 <div id="lightbox-panel"> <?php echo $this->getLayout()->cr
<div id="lightbox-panel">
<?php echo $this->getLayout()->createBlock('core/template')->setTemplate('contacts/formlite.phtml')->toHtml(); ?>
<p align="center">
<a id="close-panel" href="#">Close this window</a>
</p>
</div><!-- /lightbox-panel -->
此div标记显示为:起初为无。当点击联系人链接时,它会显示这个div并回显来自该div的联系人块。有人能告诉我如何使这个表单工作吗?
这是联系人表单和后续提交按钮的html:
<form action="/contacts/index/post" id="contactForm" method="post">
<div class="buttons-set" style="margin-bottom:1em;">
<input type="text" name="hideit" id="hideit" value="" style="display:none !important;" />
<button type="submit" title="<?php echo Mage::helper('contacts')->__('Submit') ?>" class="button btn-saveadd"><span><span><?php echo Mage::helper('contacts')->__('Submit') ?></span></span></button>
</div>
我在索引控制器中添加了一个新操作,并从那里调用了新联系人表单的块。在创建的新操作的布局句柄下的XML文件中添加了该新phtml文件的块。看起来是这样的
<contacts_index_quickcontact translate="label">
<remove name="head" />
<reference name="root">
<action method="setTemplate"><template>page/empty.phtml</template></action>
</reference>
<reference name="content">
<block type="core/template" name="contactForm" template="contacts/formquick.phtml"/>
</reference>
</contacts_index_quickcontact>
page/empty.phtml
希望它也能帮助其他人。你能发布结果HTML吗?这就是实际的标记吗?如果是这样的话,它就不工作了,因为它输出的是php而不是HTML来服务于客户端。php代码将在输出中删除。其余的都一样。你能提供输出吗?全部输出。你的javascript呢?