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 3 of 3
  1. #1
    Regular Coder
    Join Date
    Nov 2004
    Location
    Perth, UK
    Posts
    105
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Form Validation Not Working

    I have a form that I want to prevent people from spamming with missing fields, as the information gathered by the form is inserted into a database using PHP, and it is a pain in the butt deleting all the empty entries every day.

    The form only has three text boxes. How can I add validation to them using JavaScript, preventing people spamming the hell out of my poor databases?
    Geodesic_D
    "I'd much rather be called GeodesicDragon."

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    We would need to see the form and your attempt at coding the validation. No one is going to code it for you. We can help you with it though. Furthermore you would still need to validate the form server side just in case js is disabled.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    10,950
    Thanks
    0
    Thanked 236 Times in 233 Posts
    The best solution is to use server-side validation as javascript can be easily disabled. You must also code against sql injection attack.


  •  

    Posting Permissions

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