title: Magento contact form redirect
body: <p>I'm working on a new site build and the site has two contact forms which run off the same controller. At the moment the form on the contact page loads a small message saying 'thanks for your inquiry' etc.. The form on the 'gallery' page, once it's submitted sends the user to the contact page and displays the same message.</p>
  
  <p>However what I want is to keep the user on the page they are currently on and then display the message. Exactly what's currently happening on the contact page.</p>
  
  <p>If I change this piece of code:</p>
  
  <pre><code>$this-&gt;_redirect('*/*/');
  </code></pre>
  
  <p>in /code/core/Mage/Contacts/controllers/IndexController.php I can get it to re-direct to the homepage etc but I just want it to display the message on the page i'm on.</p>
  
  <p>Here is the code to my form:</p>
  
  <pre><code>&lt;form action="&lt;?php echo Mage::getUrl(); ?&gt;contacts/index/post/" id="contactForm" method="post"&gt;
  &lt;input type='hidden' name='formtype' value='Contact Us Page'/&gt;
          &lt;div class="fieldset"&gt;
                 &lt;ul class="form-list"&gt;
                  &lt;li class="fields"&gt;
                      &lt;div class="field"&gt;
  &lt;div class="input-box"&gt;
  &lt;input onfocus="if(this.value == 'Name'){this.value = '';}"  name="name" id="name" title="&lt;?php echo Mage::helper('contacts')-&gt;__('Name') ?&gt;"  class="input-text required-entry" type="text" onblur="if(this.value == ''){this.value='Name';}" value="Name"/&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
  
                       &lt;li&gt;
  &lt;div class="input-box"&gt;
  &lt;input name="company" id="company" onfocus="if(this.value == 'Company'){this.value = '';}" title="&lt;?php echo Mage::helper('contacts')-&gt;__('Company') ?&gt;" value="Company" onblur="if(this.value == ''){this.value='Company';}" class="input-text" type="text" /&gt;
                      &lt;/div&gt;
                  &lt;/li&gt;
                      &lt;div class="field"&gt;
                        &lt;div class="input-box"&gt;
  &lt;input name="email" id="email" onfocus="if(this.value == 'Email'){this.value = '';}" title="&lt;?php echo Mage::helper('contacts')-&gt;__('Email') ?&gt;" value="Email" onblur="if(this.value == ''){this.value='Email';}" class="input-text required-entry validate-email" type="text" /&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                  &lt;/li&gt;
  
                  &lt;li class="wide"&gt;
                      &lt;!--&lt;label for="comment" class="required"&gt;&lt;em&gt;*&lt;/em&gt;&lt;?php echo Mage::helper('contacts')-&gt;__('Comment') ?&gt;&lt;/label&gt;--&gt;
                      &lt;div class="input-box"&gt;
                          &lt;textarea name="comment" id="comment" onfocus="if(this.value == 'Enquiry details'){this.value = '';}" title="&lt;?php echo Mage::helper('contacts')-&gt;__('Comment') ?&gt;" class="required-entry input-text" onblur="if(this.value == ''){this.value='Enquiry details';}" cols="5" value="Enquiry details" rows="3"&gt;Enquiry details&lt;/textarea&gt;
                      &lt;/div&gt;
                  &lt;/li&gt;
              &lt;/ul&gt;
          &lt;/div&gt;
          &lt;div class="buttons-set"&gt;
  &lt;input type="text" name="hideit" id="hideit" value="" style="display:none !important;" /&gt;
              &lt;button class="submit" type="submit" title="&lt;?php echo Mage::helper('contacts')-&gt;__('Submit') ?&gt;" class="button"&gt;&lt;span&gt;&lt;span&gt;&lt;?php echo Mage::helper('contacts')-&gt;__('Submit') ?&gt;&lt;/span&gt;&lt;/span&gt;&lt;/button&gt;
  &lt;/div&gt;
  &lt;/form&gt;
  
  
  
  
  &lt;script type="text/javascript"&gt;
  //&lt;![CDATA[
      var contactForm = new VarienForm('contactForm', true);
  //]]&gt;
  &lt;/script&gt;
  </code></pre>