Make phpsendmail form show popup error if field is missed?

Discussion in 'PHP' started by Anveto, Feb 21, 2010.

  1. #1
    Currently i have a form which shows an error page if a field is not filled out on the form, i was wondering if there was any guides or if someone could tell me how i can make a little popup window with an error message display if there are missing fields.

    Thanks
     
    Anveto, Feb 21, 2010 IP
  2. jcwebhole

    jcwebhole Active Member

    Messages:
    93
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    51
    #2
    probably you might need to encode some error handling functions...
    so before actually calling in mail() you might want to verify your fields are correctly filled..
    e.g.
    email is valid and not blank

    just simple error checking before you send out the mail
     
    jcwebhole, Feb 21, 2010 IP
  3. Anveto

    Anveto Well-Known Member

    Messages:
    697
    Likes Received:
    40
    Best Answers:
    19
    Trophy Points:
    195
    #3
    I already have that, and it brings a user to an error page

    what i want to do is make a pop-up with the error before they are redirected from the page where they filled out the information
     
    Anveto, Feb 21, 2010 IP
  4. jcwebhole

    jcwebhole Active Member

    Messages:
    93
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    51
    #4
    oic... this can be achieved in many ways...
    either you get javascript running for testing on the fly... (highlight a field if error, display message anywhere or an alert box...etc)
    or you can have it submit to the same page or an error catch page.. before executing the script in another set of page and/or functions
     
    jcwebhole, Mar 8, 2010 IP
  5. Rory M

    Rory M Peon

    Messages:
    1,020
    Likes Received:
    37
    Best Answers:
    0
    Trophy Points:
    0
    #5
    This would be something that you'd want to do dynamicly on the form page rather than through PHP on the server side.
     
    Rory M, Mar 8, 2010 IP