Solved

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

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
asp day pilot 3 18
Delete HTML table rows 12 28
Switching Visual Studio 2015 to normal debug display 3 25
Save ms data to server side. 19 42
I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

786 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