Forum Moderators: open

Message Too Old, No Replies

Text Field Validation

         

uberandy

8:15 pm on Nov 7, 2005 (gmt 0)



Is it possible to scan a user submitted multiline text field on submit for things like email addresses or website urls? we don't want our users to be able to submit personal info like this in a publicly displayed area.

If anyone has some examples that work I would appreciate it.

directrix

9:09 pm on Nov 7, 2005 (gmt 0)

10+ Year Member



Welcome to WebmasterWorld!

It would be quite tricky to prevent someone from revealing personal information. You could check a text field for a valid email address, for example, using Javascript on the client side, or a scripting language such as Perl or PHP on the server side. But what's to stop someone who's determined to circumvent the restrictions from typing "someone at example dot com"? Then if you block that, there's always another way.

Another point is that, to be effective, you would need to perform such validation on the server. It would be easily defeated in the browser by the user simply switching off Javascript.

technossomy

1:18 pm on Nov 8, 2005 (gmt 0)

10+ Year Member



Hi uberandy

Separating semantical from syntactical validation is a complex undertaking. The most robust websites indeed have client-side and server-side validation, mostly syntactical.

There are others, but you may find what you are looking for here:
[pear.php.net...]

Hope this helps

Tech