SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    May 2005
    Posts
    41
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Ajax Forum Reply

    Hey guys,

    I'm in the process of working on a remake of my site and have run into a pickle - how can I create a no-refresh form submit? I have a quick reply option in my own made forum but have no idea on how to implement the reply box to bring up the reply on the same screen.

    Any ideas/tips would be most helpful

    Cheers,
    Jorge

  2. #2
    I meant that to happen silver trophybronze trophy Raffles's Avatar
    Join Date
    Sep 2005
    Location
    Tanzania
    Posts
    4,662
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    1. User clicks submit button.
    2. String is POSTed to script on server using XHR
    3. Server parses string and does stuff to it. Turns smilies into images, censors bad words, turns line breaks into <p></p>, formats text with <em> and <strong>, parses BBcode, etc. If everything seems OK with the reply and the user that's making it, server stores reply in database.
    4. Script on server-side successfully stores reply on database. It may then surround it with the containing box a reply consists of as well.
    5. Server responds to Ajax request with new reply string.
    6. Javascript receives string and inserts it into DOM (using innerHTML most likely).


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
  •