SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict trican's Avatar
    Join Date
    Sep 2003
    Location
    someplace
    Posts
    211
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Submit form without reloading page

    Hi all,

    I wish to submit a form without reloading the page, so I'm guessing I need some ajax to handle this. Here is an example of a simplified form:

    HTML Code:
    <form action="email.php" method="post" id="contact">
    <textarea name=msg id="msg"></textarea>
    <input name="submit" type="submit" value="submit">
    </form>
    So I'm guessing I need some javascript or even better some jQuery, such as
    Code JavaScript:
    $('#contact').submit(function() {
        $.post("contact.php",{msg : $(#msg)});
        return false;
    });


    Is this the right approach? Its not quite working for me
    Free Image Editing Webapp, includes
    easy to use creative transformations to
    enrich your digital photographs @www.PureRGB.com

  2. #2
    SitePoint Member
    Join Date
    Apr 2011
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if i think correct then maybe this can help
    http://www.sitepoint.com/forums/java...ml#post4877647


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
  •