TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Paul Rajs
NA
641
148.1k
How to Mask first 6 digits as X when entering Aadhar Card No using jqu
Aug 20 2020 11:02 PM
Hi Developers ,
I have to Keep the div value without change first 6 digits as XXXXXX
Also need to edit if the user enter wrong Aadhar card number as well.
In the below code after release cursor or press tab action below
Textbox value : 8693-3764-2252
after enter tab = XXXX-XX64-2252
if i edit the text box value means the dvCCN value has been updated as same as XXXX-XX64-2252 ..
but it should be give the value without change first 6 digits as XXXXXX
This is my requirement ... if anyone know the solution kinldy suggest me
Am using the below Code
Jquery:
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$("#txtCCN").on('blur', function () {
var CCNValue = $(this).val();
$('#dvCCN').html(CCNValue);
$(this).val(CCNValue.substring(0, 7).replace(/\d/g, "X") + CCNValue.substring(7));
});
});
</script>
Html
<body>
<input type="text" id="txtCCN" maxlength="14" />
<div id="dvCCN"></div>
</body>
Reply
Answers (
2
)
How to force an array while converting xml to Json ?
Change Date Format of jQuery Datepicker to dd/mm/yy