开发者

show last four digits of SSN

I want to only show the last four digits of a Social security number after they leave the textbox. Does AJax have a tool for this that I am not aware of? How can i do this? I want to replace the digits with '*开发者_如何学JAVA'. I'm working in .NET. Ajax is also accessible.


To my knowledge, there isn't a control that does this in the ASP.NET AJAX library, but the way we handle it is to use three text boxes separated by labels containing dashes. The first two are password boxes and the last one is a normal text box. It's kind of ghetto, but it works.


var el = document.getElementById('MyTextBoxId');
el.value = '***-**-' + (el.value.replace(/-/g,'') % 10000);

You probably also want a separate hidden input to save the original data...

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜