www.webdeveloper.com
Results 1 to 4 of 4

Thread: Javascript Question

  1. #1
    Join Date
    Dec 2009
    Posts
    1

    Exclamation Javascript Question

    Is it possible to not allow a user to post something to website unless they have Javascript turned on in their browser? The reason I am asking is because in a test website i'm building I have a bad words filter written in javascript that filters submissions from an HTML form and I don't want someone to be able to bypass it by just turning off Javascript.

  2. #2
    Join Date
    May 2004
    Location
    Manhattan NY
    Posts
    6,028
    sure it's possible. You can accomplish this in a number of ways but it basically comes down to one premise: have something on the page which is crucial to posting be activated by JavaScript. You can set any crucial page element to "display: none;" in your CSS and then with JavaScript on load set it to display: block; or whatever.

  3. #3
    Join Date
    Dec 2008
    Posts
    488
    You're processing your form on the server-side, correct? Why not disallow the taboo content on the server-side use it as validation just the same? You could return an error, just like you would if the user did not enter an email address or something. That way you completely eliminate the need for that piece of JavaScript altogether.

  4. #4
    Join Date
    Dec 2003
    Location
    Bucharest, ROMANIA
    Posts
    15,428
    Always use two filters: client-side and server-side

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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



Recent Articles