Solved

Auto Tab coding on ASP.Net web form does not tab on Social Security Number

Posted on 2012-03-29
2
356 Views
Last Modified: 2012-03-29
Hi Everyone,

I have attached some javscript coding.  The computer is not tabbing when the first three numbers are entered for SSN1.
ContentMasterRevised.doc
RevisedContentPageCoding.doc
0
Comment
Question by:jjc9809
2 Comments
 
LVL 7

Accepted Solution

by:
Lalit Chandra earned 500 total points
ID: 37784092
hi
Everything is write in your Master page & content page code.
you have to do only little thing on the Content page. Just replace whole script section of the content page ( which is written in the last section) with the following script


    <script type="text/javascript" language="javascript">
        $(function () {
            var $SSN1_ch = $("input[id*='SSN1_ch']");
            var $SSN2_ch = $("input[id*='SSN2_ch']");
            var $SSN3_ch = $("input[id*='SSN3_ch']");

            $SSN1_ch.keyup(function (e) {
                if ($(this).val().length == parseInt($(this).attr("maxlength"))) {
                    $SSN2_ch.focus();
                }
            }).bind('keypress', function (e) {
                if ((e.keyCode ? e.keyCode : e.which) == "13") {
                    $SSN2_ch.focus();
                    e.preventDefault();
                }
            });
            $SSN2_ch.keyup(function (e) {
 
                if ($(this).val().length == parseInt($(this).attr("maxlength"))) {
                    $SSN3_ch.focus();
                }
            }).bind('keypress', function (e) {
                if ((e.keyCode ? e.keyCode : e.which) == "13") {
                    $SSN3_ch.focus();
                    e.preventDefault();
                }
            });
            $SSN3_ch.keyup(function (e) {
                if ($(this).val().length == parseInt($(this).attr("maxlength"))) {
                    $(this).nextAll('input:first').focus();
                }
            }).bind('keypress', function (e) {
                if ((e.keyCode ? e.keyCode : e.which) == "13") {
                    $(this).nextAll('input:first').focus();
                    e.preventDefault();
                }
            });

        });
    </script>

I have tested on my end. and it 's running accourding to your aspectation i.e, automatic tab when max digit has been entered and also automatic tab on Enter. I have tested only on the

SSN1_ch
SSN2_ch
SSN3_ch

textboxex.

Hope this will solve all of your query.
0
 

Author Closing Comment

by:jjc9809
ID: 37784482
Lalit Chandra,

Thanks, I got it to work! I will go ahead and close out the post and award you some more points.  Very pleased.

jjc9809
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

AJAX ModalPopupExtender has a required property "TargetControlID" which may seem to be very confusing to new users. It means the server control that will be extended by the ModalPopup, for instance, if when you click a button, a ModalPopup displays,…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This video discusses moving either the default database or any database to a new volume.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now