PDA

View Full Version : Form - blocking certain words


Finland Blue
05-22-2008, 05:48 AM
On a Form, is it possible, in a text field, to block certain words? By that, I mean if a user of the form types in a certain word then the form cannot be submitted?

davidj
05-22-2008, 07:36 AM
what language are you using to process the form

Finland Blue
05-22-2008, 09:44 AM
I'm using a CGI script (simple form mail)

davidj
05-22-2008, 05:09 PM
shucks

thats me out

im not a perl guy

domedia
05-22-2008, 05:32 PM
On a Form, is it possible, in a text field, to block certain words? By that, I mean if a user of the form types in a certain word then the form cannot be submitted?
Yes, you can check a list of words to see if any matches.

Finland Blue
05-23-2008, 09:35 AM
Hello Domedia,

Thanks for the reply, but I'm not sure what you mean.

I want to block a certain word - lets say "Rabbit" - if a user types the word "Rabbit" into my form, they should get a message saying "Rabbit is not allowed" or something like that, meaning they cannot submit the form if they include that word.

pete
05-23-2008, 11:12 AM
If you upload your perl script I'll take a look, I know just about enough perl to knit a nice scarf so I can't guarantee I can do it but I'll have a go.

pete
05-23-2008, 11:32 AM
You can do it with JavaScript like this

http://69.5.28.129/dwclub/word-filter.htm

but the problem is if someone disables JS it won't work.

domedia
05-23-2008, 12:53 PM
Yes, you can check a list of words to see if any matches.

Hello Domedia,

Thanks for the reply, but I'm not sure what you mean.
Just wanted to answer your question 'is it possible?', I thought that was obvious ;-)