开发者

AS3 - Allow Forward Slash In Input Text?

I'm trying to allow forward slashes to be entered in my input text field through this code:

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

The above text field should allow uppe开发者_如何学JAVAr case letters, lower case letters, periods, hyphens and forward slashes. However, I can't seem to permit the forward slash.


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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜