SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Enthusiast Kisan's Avatar
    Join Date
    Jun 2003
    Location
    India
    Posts
    95
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    HTML Form and thank you on the same location of the page

    On a Web page, I have a form requesting for a demo.
    When one submits the form, I need to displays Thanks in the same location of the webpage without refreshing and send a e-mail to me.
    I hope I have made myself clear.

    Thanks in advance.

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,317
    Mentioned
    460 Post(s)
    Tagged
    8 Thread(s)
    With PHP, you can have the Thankyou message appear in place of the form (on the same page), but as far as I know, the page still needs to refresh for this to happen.

  3. #3
    SitePoint Enthusiast Kisan's Avatar
    Join Date
    Jun 2003
    Location
    India
    Posts
    95
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The page is a HTML page and not php. There are several other elements on the page, among them is this HTML form with just two fields Name and E-mail. When on submits it, I need to say thanks at the same location of the form without refreshing the page.

    I know the PHP method.

  4. #4
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,317
    Mentioned
    460 Post(s)
    Tagged
    8 Thread(s)
    You would have to use JS then, but it is less reliable (as users may have it disabled). I am always wary when people say they "need" something. Is it really a need?

  5. #5
    SitePoint Enthusiast Kisan's Avatar
    Join Date
    Jun 2003
    Location
    India
    Posts
    95
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It is not my need. Client wants it, as this form is on the landing page.

  6. #6
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,317
    Mentioned
    460 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by Kisan View Post
    It is not my need. Client wants it
    Yes, that's usually the case. I get frustrated by clients who want things that aren't practical, or that are purely to satisfy their vanity at the expense of usability. Anyway, sorry for the rant! Having other elements on the page is not a problem as far as PHP goes. Anyhow, a combination of JS/Ajax and PHP might be the best solution, but I'm not qualified to advise on that. Hopefully someone else will step in now.

  7. #7
    SitePoint Wizard silver trophybronze trophy Cups's Avatar
    Join Date
    Oct 2006
    Location
    France, deep rural.
    Posts
    6,869
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    This search results should give you a start : submit a form using jquery and refresh content in div.

    Get this working using the simplest html page possible to prove to yourself the concept works, then add back into a PHP page.

    If you do end up having PHP output JS then you are going to have to be very careful with your single/double quotes and you should look at using the HEREDOC syntax for that.

  8. #8
    SitePoint Enthusiast Kisan's Avatar
    Join Date
    Jun 2003
    Location
    India
    Posts
    95
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Cups, I will check it out.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •