ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Contact Form Not Working

April 22, 2012 2:57pm

Subscribe [3]
  • #1 / Apr 22, 2012 2:57pm

    Danny Valle

    21 posts

    Hello, I am having an issue where the contact form is not working at all.  When I click on the submit button, it takes me to the home page and does nothing. Here is the code that I am using:

    {exp:email:contact_form
      user_recipients="no" 
      recipients="[email protected]" 
      charset="utf-8" 
      name="contactForm" 
      replyto="no" 
      redirect="5" 
      return="{site_url}"
      form_id="trialForm"
     }
      
      <!-- SUBJECT -->
      <input type="hidden" id="subject" name="subject" value="Trial class">
      
      <!-- MESSAGE -->
      <input type="hidden" name="message">
      
      <!-- NAME -->
      <label for="name">Name:</label>
    
      <input type="text" id="name" name="required[]" class="field" autocomplete="on"><br>
    
      <!-- PHONE -->
      <label for="phone">Phone:</label>
    
      <input type="text" id="phone" name="required[]" class="field" autocomplete="on"><br>
      
      <!-- EMAIL -->
      <label for="from">Email:</label>
    
      <input type="text" id="from" name="from" class="field" autocomplete="on"><br>
    
      <!-- LINK -->
      <a href="#" title="Get Started Today" class="formButton">Get Started Today</a>
     {/exp:email:contact_form}

    Any ideas as to what the problem may be?

  • #2 / Apr 23, 2012 1:03pm

    Shane Eckert

    7174 posts

    Hello Danny Valle,

    Thank you for posting your question here on the ExpressionEngine forums.

    Your return page is set as return=”{site_url}” which will be your homepage. So that is why you are being returned to the home page.

    Why it’s not sending mail ... hmmm.

    Are you able to use the communication tool from the Control Panel? Are you sure mail can be sent from your server?

    Please let me know.

    Cheers,

  • #3 / Apr 23, 2012 1:10pm

    Danny Valle

    21 posts

    I was able to use the communication tool.  The return url always goes to the home page no matter what I put in there. Not sure if that helps any.

  • #4 / Apr 23, 2012 11:29pm

    davusername

    2 posts

    I am having the same problem. Under Admin > General Configuration, is this field blank?: Name of your site’s index page

  • #5 / Apr 24, 2012 1:53pm

    Shane Eckert

    7174 posts

    Hey Danny,

    Is the homepage still the default 404 result? Or have you made it something else. It could be the page you are directing to when not using {site_url} is not found or that the form is failing. If the form is failing, then that would explain the email as well.

    What if you use a brand new template and paste in this very simple form?

    {exp:email:contact_form user_recipients="no" recipients="[email protected]" charset="utf-8"}
            <h2>Support Form</h2>
    <p>        <br />
                    <label for="from">Your Email:</label></p>
    
    <p>                <input type="text" id="from" name="from" size="40" maxlength="35" value="{member_email}" /><br />
            <br />
            <br />
                    <label for="subject">Subject:</label></p>
    
    <p>                <input type="text" id="subject" name="subject" size="40" value="Contact Form" /><br />
            <br />
            <br />
                    <label for="message">Message:</label></p>
    
    <p>                <textarea id="message" name="message" rows="18" cols="40"><br />
                            Support Email from: {member_name}<br />
                            Sent at:  {current_time format="%Y %m %d"}<br />
                    </textarea><br />
            <br />
            <br />
                    <input name="submit" type='submit' value='Submit Form' /><br />
            <br />
    {/exp:email:contact_form}

    Do you get the same results?

    Thank you,

     

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases