JavaScript RegEx

    Date: 08/08/06 (Web Development)    Keywords: php, database, java

    So I've been relying primarily on PHP's preg_match for 100% of my form validation. Now I'm beginning to suspect it would be much cleaner to have JavaScript handle most of that (check for blank/empty inputs, or reject inappropriate characters/patterns) and simply leave the database checking for PHP (right or wrong login info, etc). Then I can have PHP handle all that stuff with AJAX-stuff, but not let bad input data even get out to the server in the first place. Of course, there's the local overhead a user will have to deal with, and slightly larger JavaScript file to load, but I could probably finagle it so it had all the regex script in a seperate file that it looks at when it needs it.

    What do you folks think?

    Source: http://community.livejournal.com/webdev/342757.html

« RFC: Tables vs CSS vs CSS... || CSS table free issues »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home