Form not working properly

Discussion in 'WordPress' started by sabahat, Jun 16, 2014.

  1. #1
    I converted the html site to WP recently

    on the contact page here xxxxx
    The problem is when the form is filled in and sent, the homepage appears and the thank you message appear on the home page [This thank you message is a part of small form on the homepage So should not be displayed as a thank you message of contact page] In fact a thank you message should appear in the same div same page [contact page]

    On a side note all the forms on the website are having the same issue [Thank you msg of all forms appear on homepage] but just to keep my question simple I have just mentioned contact page.

    Html version of same site works fine.
    xxxxx
    Have a look and submitting the form would give you a proper idea of what I am after

    I would highly appreciate if you helped me track down the issue and sort it.
     
    Last edited: Jun 16, 2014
    sabahat, Jun 16, 2014 IP
  2. Hefaistos

    Hefaistos Active Member

    Messages:
    194
    Likes Received:
    14
    Best Answers:
    9
    Trophy Points:
    63
    Digital Goods:
    1
    #2
    You should set the form action to <?php the_permalink(); ?> to validate the data sent by the form on the same page. Therefore, you will need to copy the code from contact.php above the HTML form (in the same template file).
     
    Hefaistos, Jun 16, 2014 IP
  3. sabahat

    sabahat Member

    Messages:
    36
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #3
    Hey thanks I just put form action to <?php the_permalink(); ?> and it worked! perfect your are a star!
     
    sabahat, Jun 16, 2014 IP