struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rod Morris <rodney.w.mor...@gmail.com>
Subject Validator, JavaScript, Quotation Mark
Date Thu, 26 May 2005 16:14:46 GMT
Hello to all you gurus out there.

I'm attempting to use the validator to prevent users from entering a 
quotation mark into a form field with the following mask: ^[^"]*$

The problem I'm running into is this...it works great on the server-side but 
it's breakng my client-side JavaScript validation because it fails to escape 
the quotation marks with a backslash. 

I checked the code for the 
org.apache.struts.taglib.html.JavaScriptValidatorTag and it appears that 
it's only escaping backslash characters (which prevents me from escaping it 
myself). 

I suppose I could customize the JavascriptValidatorTag to get the desired 
behavior but I really don't wish to branch from the standard for something 
as minor as this. Is there configuration setting or a mask that will allow 
me to get the behavior I would like without having to customize the jar 
file?

Sincerely and many thanks,

Rodney Morris
rodney.w.morris@gmail.com

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message