I have a frontend form in my custom module. On submitting the form,I want to display the success message in a popup with some custom content. How is it possible? Please help.
This is my controller.
public function formAction()
{
if ($this->getRequest()->getPost()){
//My Action
// Mage::getSingleton('core/session')->addSuccess('Your Request has been sent');
$this->_redirect("*/");
}
This is my phtml
<form id="test_sample_form" method="post" action="<?php echo $this->getUrl('module/controller/action') ?>">
<fieldset class="group-select">Test Fields</fieldset>
</form>
I want to display the success message in a popup. Please help.
Best Answer
Submit the form via ajax
Use this script in your phtml: