lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kelvin Tan" <>
Subject Javascript query validation
Date Wed, 10 Apr 2002 09:41:24 GMT
Note: this file has only been tested in IE 6.0.

Frustrated with curious TokenMgrErrors and ParseExceptions in your web
forms? (I was) Not so good at regular expressions? (I'm not)

See attached for a (simple) implementation of a regex-based javascript query
validator. Currently, only wildcards (*), plus and minus (+, -), parentheses
(round brackets) and field declarers (:) are validated for. The reason's coz
they're the most commonly used (IMHO) and I'm lazy.

If you do add to it/fix any bugs, I'd appreciate if you could drop me a buzz
so I can update it, or post it to the list for everyone to use.

Note: I've found that in IE at least, hitting the enter button with a text
field in focus irritatingly submits the form without giving me a chance to
validate the query. I've had to disable the "Enter" key for the form fields.
Email me offline if you need help with this.

Kelvin Tan

Relevanz Pte Ltd

180B Bencoolen St.
The Bencoolen, #04-01

Tel: 6238 6229
Fax: 6337 4417

View raw message