Alert box

Discussion in 'PHP' started by zed420, Nov 4, 2008.

  1. #1
    Hi ALL
    Can anyone tell me how can I use alert error messages without wiping out all the information that user has put in. eg. I have a form if user makes mistake inserting his/her password an error messages pop up (alert box) but it wipes out rest of the form too. Is there any way I can keep rest of the inserted information.:confused:
    Thanks
    Zed
     
    zed420, Nov 4, 2008 IP
  2. jacobbannier

    jacobbannier Active Member

    Messages:
    1,155
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    90
    #2
    Post your PHP code so people can have a look?
    Use the PHP (
    ) Code to make it easier for people to see.
    PHP:
     
    jacobbannier, Nov 4, 2008 IP
  3. live-cms_com

    live-cms_com Notable Member

    Messages:
    3,128
    Likes Received:
    112
    Best Answers:
    0
    Trophy Points:
    205
    Digital Goods:
    1
    #3
    Use javascript to validate the input, if it doesn't validate 'return false'.

    Otherwise in PHP you can return the form with each field having
    value="<?php echo $_POST['name']; ?>"
    Code (markup):
     
    live-cms_com, Nov 4, 2008 IP
  4. Amisha_Sharma

    Amisha_Sharma Banned

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Hi

    You can use javascript for checking the values in the fields and show alert box on wrong input.
     
    Amisha_Sharma, Nov 5, 2008 IP
  5. zed420

    zed420 Member

    Messages:
    60
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #5
    Thank you all

    Zed
     
    zed420, Nov 5, 2008 IP