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
Akhter HUssain
712
1.3k
103.3k
Textbox input character pattern?
Sep 11 2019 5:28 AM
i want textbox input pattern like this (1111-111111-5254) and i used this code ,means that when i select row from gridview for editing then in popup window textbox show(-) ,but below code is not working
//CNIC
$(
"#txtCNIC"
).attr(
'maxlength'
,
'16'
);
$(
'#txtCNIC'
).on(
'keyup'
,
function
() {
var
inp = $(
'#txtCNIC'
).val();
var
noinp = inp.split(
'-'
).join(
''
);
if
(noinp.length > 4 && noinp.length <= 10) {
$(
'#txtCNIC'
).val(noinp.substring(0, 4) +
'-'
+ noinp.substring(4, noinp.length));
}
else
if
(noinp.length > 10 && noinp.length <= 14) {
$(
'#txtCNIC'
).val(inp.substring(0, 11) +
"-"
+ noinp.substring(10, noinp.length));
}
});
Reply
Answers (
2
)
.net web api and mvc both seperate app creation
C# MVC Visual Studio 2015