Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Jun 2010
    Thanked 0 Times in 0 Posts

    If Javascript is disabled would a form get submitted?

    Wasnt sure if I should post this in the JS or HTML forum.

    I am relatively new to web programming (1.5 years) and this question just occurred to me.

    I use jquery form validation to validate forms on my site. If my browser has javascript disabled, what is stopping someone from submitting crap through my form?

    I tried disabling javascript and submitting a form on my site and it posted.

    Is there a way to make it so if the user does not have javascript enabled the form cannot post?

  • #2
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Halle (Saale), Germany
    Thanked 1,052 Times in 1,025 Posts
    Rule number one in form development: Always implement server-side validation, never rely on JavaScript. As you correctly see, with JS disabled you can post any crap if a server side script (PHP/ASP/JSP/CF/…) doesn’t check the input on submit. JavaScript validation is only meant to enhance the usability, not as only method to check form input.


    Posting Permissions

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