开发者

jquery mask output

I have a jquery masked textbox which has a mask:

$("#txthtml").mask("99/99/9999");

When I check the output, it has the '/' in its value. Is there an easy way to get only what the user entered and nothing else? So if text box read 01/01/1990 I want 01011开发者_如何转开发990 .

Same thing if I have a phone number mask, how can I get the user input only?


JavaScript can replace the / characters with an empty string: yourDateString.replace(/\//g, "")


Use a regexp to strip the '/' characters, or do split/join:

"01/01/1990".split("/").join("");
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜