Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4

Thread: Error message

  1. #1
    New Coder
    Join Date
    Oct 2012
    Posts
    18
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Error message

    i made a form that has unique values,and when i enter values that are already in database and click submit button an error message(500) pops out because there are already values with the same data,i want it to be that way...but my question is,can i somehow override the output of this error,i want to show it only to the user as an usual alert box?

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,079
    Thanks
    203
    Thanked 2,542 Times in 2,520 Posts
    "The usual alert box" is very much deprecated these days, and should be used only for debugging purposes.


    All advice is supplied packaged by intellectual weight, and not by volume. Contents may settle slightly in transit.

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

  • #3
    Regular Coder
    Join Date
    Apr 2012
    Location
    St. Louis, MO
    Posts
    985
    Thanks
    7
    Thanked 101 Times in 101 Posts
    I'm assuming PK/FK constraints in the database.

    You can always check to see if the data is already present, then return a message stating so and have the alert display the message.
    ^_^

    If anyone knows of a website that can offer ColdFusion help that isn't controlled by neurotic, pedantic jerks* (stackoverflow.com), please PM me with a link.
    *
    The neurotic, pedantic jerks are not the owners; just the people who are in control of the "popularity contest".

  • #4
    New Coder
    Join Date
    Oct 2012
    Posts
    18
    Thanks
    0
    Thanked 0 Times in 0 Posts
    the code is really messed up because i am recoding joomla component,this is the best solution i think...i only need this last thing...


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •