Click here to Skip to main content
15,886,873 members
Home / Discussions / JavaScript
   

JavaScript

 
GeneralRe: Local data Pin
rrrado23-Nov-10 3:47
rrrado23-Nov-10 3:47 
GeneralRe: Local data Pin
Not Active23-Nov-10 4:13
mentorNot Active23-Nov-10 4:13 
GeneralRe: Local data Pin
rrrado23-Nov-10 5:31
rrrado23-Nov-10 5:31 
GeneralRe: Local data Pin
fjdiewornncalwe23-Nov-10 4:39
professionalfjdiewornncalwe23-Nov-10 4:39 
GeneralRe: Local data Pin
rrrado23-Nov-10 5:16
rrrado23-Nov-10 5:16 
GeneralRe: Local data Pin
fjdiewornncalwe23-Nov-10 5:46
professionalfjdiewornncalwe23-Nov-10 5:46 
GeneralRe: Local data Pin
Not Active23-Nov-10 5:49
mentorNot Active23-Nov-10 5:49 
QuestionAsp.net Textbox Editing Problem due to the following Javascript Pin
Vimalsoft(Pty) Ltd22-Nov-10 4:35
professionalVimalsoft(Pty) Ltd22-Nov-10 4:35 
It is that time of the day. hungry i cant cope anymore Frown | :(

I have a Javascript written like this



function Jump() { 

           var txtUnitLen1 = document.getElementById("<%= txtUnitLen1.ClientID %>").value;
           var txtUnitLen2 = document.getElementById("<%= txtUnitLen2.ClientID %>").value;
           var txtUnitLen3 = document.getElementById("<%= txtUnitLen3.ClientID %>").value;
           var txtUnitLen4 = document.getElementById("<%= txtUnitLen4.ClientID %>").value;
           var txtUnitLen5 = document.getElementById("<%= txtUnitLen5.ClientID %>").value;
           var txtUnitLen6 = document.getElementById("<%= txtUnitLen6.ClientID %>").value;
           var txtUnitLen7 = document.getElementById("<%= txtUnitLen7.ClientID %>").value;
           var txtUnitLen8 = document.getElementById("<%= txtUnitLen8.ClientID %>").value;
           var txtUnitLen9 = document.getElementById("<%= txtUnitLen9.ClientID %>").value;
           var txtUnitLen10 = document.getElementById("<%= txtUnitLen10.ClientID %>").value;
           var txtUnitLen11 = document.getElementById("<%= txtUnitLen11.ClientID %>").value;
           var txtUnitLen12 = document.getElementById("<%= txtUnitLen12.ClientID %>").value;
           var txtUnitLen13 = document.getElementById("<%= txtUnitLen13.ClientID %>").value;
           var txtUnitLen14 = document.getElementById("<%= txtUnitLen14.ClientID %>").value;
           var txtUnitLen15 = document.getElementById("<%= txtUnitLen15.ClientID %>").value;
           var txtUnitLen16 = document.getElementById("<%= txtUnitLen16.ClientID %>").value;
           var txtUnitLen17 = document.getElementById("<%= txtUnitLen17.ClientID %>").value;
           var txtUnitLen18 = document.getElementById("<%= txtUnitLen18.ClientID %>").value;
           var txtUnitLen19 = document.getElementById("<%= txtUnitLen19.ClientID %>").value;
           var txtUnitLen20 = document.getElementById("<%= txtUnitLen20.ClientID %>").value;
           var ddlAutoText = document.getElementById("<%= ddlAutoText.ClientID %>").value;

           if (ddlAutoText > 0) 
           {

               if (txtUnitLen1.length >= ddlAutoText)
                {
                   document.getElementById("<%= txtUnitLen2.ClientID %>").focus();
                }
               if (txtUnitLen2.length >= ddlAutoText)
                {
                   document.getElementById("<%= txtUnitLen3.ClientID %>").focus();
               }
               if (txtUnitLen3.length >= ddlAutoText) {
                   document.getElementById("<%= txtUnitLen4.ClientID %>").focus();
               }
               if (txtUnitLen4.length >= ddlAutoText) {
                   document.getElementById("<%= txtUnitLen5.ClientID %>").focus();
               }
               if (txtUnitLen5.length >= ddlAutoText) {
                   document.getElementById("<%= txtUnitLen6.ClientID %>").focus();
               }
               if (txtUnitLen6.length >= ddlAutoText) {
                   document.getElementById("<%= txtUnitLen7.ClientID %>").focus();
               }
               if (txtUnitLen7.length >= ddlAutoText) {
                   document.getElementById("<%= txtUnitLen8.ClientID %>").focus();
               }
               if (txtUnitLen8.length >= ddlAutoText) {
                   document.getElementById("<%= txtUnitLen9.ClientID %>").focus();
               }
               if (txtUnitLen9.length >= ddlAutoText) {
                   document.getElementById("<%= txtUnitLen10.ClientID %>").focus();
               }
               if (txtUnitLen10.length >= ddlAutoText) {
                   document.getElementById("<%= txtUnitLen11.ClientID %>").focus();
               }
               if (txtUnitLen11.length >= ddlAutoText) {
                   document.getElementById("<%= txtUnitLen12.ClientID %>").focus();
               }
               if (txtUnitLen12.length >= ddlAutoText) {
                   document.getElementById("<%= txtUnitLen13.ClientID %>").focus();
               }
               if (txtUnitLen13.length >= ddlAutoText) {
                   document.getElementById("<%= txtUnitLen14.ClientID %>").focus();
               }
               if (txtUnitLen14.length >= ddlAutoText) {
                   document.getElementById("<%= txtUnitLen15.ClientID %>").focus();
               }
               if (txtUnitLen15.length >= ddlAutoText) {
                   document.getElementById("<%= txtUnitLen16.ClientID %>").focus();
               }
               if (txtUnitLen16.length >= ddlAutoText) {
                   document.getElementById("<%= txtUnitLen17.ClientID %>").focus();
               }
               if (txtUnitLen17.length >= ddlAutoText) {
                   document.getElementById("<%= txtUnitLen18.ClientID %>").focus();
               }
               if (txtUnitLen18.length >= ddlAutoText) {
                   document.getElementById("<%= txtUnitLen19.ClientID %>").focus();
               }
               if (txtUnitLen19.length >= ddlAutoText) {
                   document.getElementById("<%= txtUnitLen20.ClientID %>").focus();
               }
               if (txtUnitLen20.length >= ddlAutoText) {
                   document.getElementById("<%= txtUnitLen1.ClientID %>").focus();
               }
           }


and i am setting the max length of the text on the server side. Now this is working , the main purpose of this javascript is that when the user types till the "MaxLength" of the textbox. Now this works fine, when the value of the maxlength is 3 , if a user tries to type the 4th text, it will set the focus to the next textbox.

Now my problem is that now , let us say one made a mistake in textbox 3 and want to go and edit, immidiately when you edit the text in the textbox 3 , the focus jumps quickly to textbox1 before the editing is finished. Below is the event that is used


<asp:TextBox ID="txtUnitLen1"  onKeyUp="Jump()"    runat="server" </asp:TextBox>


I just need to go and eat, i will look at your reply tomorow.

thanks again for your help
Thanks
Vuyiswa Maseko,

Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.

C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/

AnswerRe: Asp.net Textbox Editing Problem due to the following Javascript Pin
thatraja28-Nov-10 0:15
professionalthatraja28-Nov-10 0:15 
Questioninput type=button && Extjs Pin
luiz sync17-Nov-10 12:38
luiz sync17-Nov-10 12:38 
AnswerRe: input type=button && Extjs Pin
luiz sync18-Nov-10 1:49
luiz sync18-Nov-10 1:49 
QuestionTracking down functions in javascript. Pin
R-tsumami17-Nov-10 1:22
R-tsumami17-Nov-10 1:22 
AnswerRe: Tracking down functions in javascript. Pin
Nagy Vilmos17-Nov-10 1:50
professionalNagy Vilmos17-Nov-10 1:50 
AnswerRe: Tracking down functions in javascript. Pin
Pete O'Hanlon17-Nov-10 2:51
mvePete O'Hanlon17-Nov-10 2:51 
GeneralRe: Tracking down functions in javascript. Pin
fjdiewornncalwe17-Nov-10 3:42
professionalfjdiewornncalwe17-Nov-10 3:42 
GeneralRe: Tracking down functions in javascript. Pin
thatraja18-Nov-10 20:29
professionalthatraja18-Nov-10 20:29 
GeneralRe: Tracking down functions in javascript. Pin
Zhenjie Fu18-Nov-10 20:33
Zhenjie Fu18-Nov-10 20:33 
AnswerRe: Tracking down functions in javascript. Pin
Hiren solanki1-Dec-10 22:26
Hiren solanki1-Dec-10 22:26 
Questionprevent users from entering char in textbox after clicking submit button Pin
Tridip Bhattacharjee13-Nov-10 22:45
professionalTridip Bhattacharjee13-Nov-10 22:45 
AnswerRe: prevent users from entering char in textbox after clicking submit button Pin
jaypatel51214-Nov-10 8:00
jaypatel51214-Nov-10 8:00 
AnswerRe: prevent users from entering char in textbox after clicking submit button [modified] Pin
Zhenjie Fu18-Nov-10 20:10
Zhenjie Fu18-Nov-10 20:10 
AnswerRe: prevent users from entering char in textbox after clicking submit button Pin
Sunasara Imdadhusen4-Jan-11 22:21
professionalSunasara Imdadhusen4-Jan-11 22:21 
QuestionHelp - Horizontal dropdown menu Pin
Manmohan2910-Nov-10 23:15
Manmohan2910-Nov-10 23:15 
AnswerRe: Help - Horizontal dropdown menu Pin
Jules VDV12-Nov-10 9:39
Jules VDV12-Nov-10 9:39 
GeneralRe: Help - Horizontal dropdown menu Pin
Manmohan2913-Nov-10 16:15
Manmohan2913-Nov-10 16:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.