views:

31

answers:

2

i'm trying to allow forward slash to be entered in my input text field

myInputField.restrict = "A-Za-z.\\-\\/";

the above text field should allow upper case letters, lower case letters, periods, hyphens and forward slashes. however, i can't seem to permit the forward slash.

+1  A: 

You shouldn't have to escape the forward slash. Only - ^ and \.

Robusto
+1  A: 

I just pasted your code and it works as intended. I can write forward slashes without problem. Have you checked if the glyph is embedded? (in case you're embedding fonts, that is).

I'd write your code like this, though:

myInputField.restrict = "A-z.\\-/";

Since you don't need to escape forward slashes.

Juan Pablo Califano
*facepalm* the glyph wasn't embedded. thanks!
TheDarkInI1978
@TDI1978. No worries!
Juan Pablo Califano