Solved

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

Posted on 2012-03-29
2
358 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

895 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

15 Experts available now in Live!

Get 1:1 Help Now