Solved

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

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

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
IIS redirect 1 77
Regex validation 2 28
Error handling in asp.net site 5 34
Obtain cell value using column ID in DataGrid using VB.NET 2 25
Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

830 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