Home » questions » Form Validation: How do I block certain words?

Form Validation: How do I block certain words?

2006-08-15 07:30:48, Category: Programming & Design
I would like for my forms to check for certain words "on submit". If the words are in the data field, I would like for an error message to be displayed. Is there such a thing as "value dot data"? The purpose is to block spammers from using auto submitting software and repeatingly sending the same URL. Can anyone help me or send me in the right direction?

Answers

  1. Arya

    On 2006-08-15 07:57:42


    For validation U can use Regular Expression(RegEx) for mask data entry. http://en.wikipedia.org/wiki/Regular_expression but in this case U have to writing code in loop for check this or depends on your used language you can input data in array and check array contain of this data,for exampe asp.net have funtion called "Contain" that determined this array contain this value or not. U can write this code in javascript but you have to pay attention the user browser javascript off probably, thus you can rewrite this code on serverside script.
  2. kartoos5050

    On 2006-08-15 07:36:28


    you can use the required field valdater and there you can check the value
  3. Man.With.A.Plan

    On 2006-08-15 07:36:00


    .You have a long road to travel.
  4. Marc

    On 2006-08-15 07:38:54


    The problem with spammers is that they typically use an automated script, rather than actually filling out the form. This script imitates what would normally be sent out when a form is submitted. Depending on how you have the page(s) set-up, you may or may not be able to block them. If you can edit the page which checks the data sent by the form, add something to end the script and give an error if those particular words are used. Otherwise, you could try and find a JavaScript which would validate and check the data - however, JS can be turned off quite easily and if they are using the method I described above, it'd prove useless.
  5. zeropointe01

    On 2006-08-15 07:35:25


    http://www.javascriptkit.com/script/cutindex13.shtml