I have called the contact form in a cms page and then calling that CMS page to display the contact us page. Now I need to display a link on top of my page for quick contact that will open the page in lightbox. I have added the code to display this link in breadcrumbs.phtml file. The form is loaded alright but it is not getting submitted. When I click on the button nothing happens. This is the code I have used to display contact us page in a div tag.
<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 -->
This div tag is display:none at first. When the contact link is clicked it displays this div and echo the block for contact from that div. Can anyone tell me how can I make this form work?
This is the html of the contact form and the subsequent submit button:
<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>
I added a new action in my index controller and called the block of the new contact form from there. Added the block of that new phtml file in the XML file under layout handle of the new action created. So it looks something like this
Hope it helps someone else too.