How do you alert users without refreshing the page

Discussion in 'PHP' started by Imozeb, Feb 1, 2010.

  1. #1
    I have created a PHP script that checks to see if the new users username is already in the database, but I can't figure out how to alert the user about this without refreshing the page so the user loses all her imput. How do I alert the user without losing all the form data. (I thought I cout use div tags or mabye something with javascript but I'm not sure.)

    Thanks in advance!

    ~Imozeb :)
     
    Imozeb, Feb 1, 2010 IP
  2. JAY6390

    JAY6390 Peon

    Messages:
    918
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    0
    #2
    JAY6390, Feb 1, 2010 IP
  3. SmallPotatoes

    SmallPotatoes Peon

    Messages:
    1,321
    Likes Received:
    41
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Either use Ajax, or just re-draw the form with the user-submitted values pre-populated (<input name="age" value="97">).
     
    SmallPotatoes, Feb 1, 2010 IP
  4. Imozeb

    Imozeb Peon

    Messages:
    666
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Thanks everyone. :)
     
    Imozeb, Feb 2, 2010 IP