auto populate

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dmjpro
    Top Contributor
    • Jan 2007
    • 2476

    #31
    Originally posted by smiley22
    the function should married the mobile nos.

    ex. when you add 5 handset and 5 sim, each has a mobile no.
    the control is in the sims button when you clicked the 6th row which is the first sim there is a value that is retrived by one of my function, then after that, the value should be auto populate in the mobile of the first handset..and then the 7th row which is the second sim in the table..should auto populate the mobile to the second handset etc...

    its like they are being married by the mobile no., so sceneario can be
    1st marrying - 5 handset, 5 sim
    2nd marrying(can be possible) 4 handset, 4 sim
    the function should know how to pair the entry in the table..
    Well !
    So you need to click on row which is greater than 5th row.

    [code=javascript]
    function getSerializedSi mLOV(obj)
    {
    var row = obj.parentNode. parentNode.rowI ndex;
    var serials = document.getEle mentsByNames("h dnOrdersSerialN o");
    var mobiles = document.getEle mentsByNames("h dnOrdersMobileN o");
    if(row>4)
    alert("Serial: " + serials[row-5].value + "\t" + "Mobile: " + mobiles[row-5].value);
    else alert("Select the proper row");
    }
    [/code]

    Debasis Jana

    Comment

    • smiley22
      New Member
      • Jun 2007
      • 54

      #32
      Originally posted by dmjpro
      Well !
      So you need to click on row which is greater than 5th row.

      [code=javascript]
      function getSerializedSi mLOV(obj)
      {
      var row = obj.parentNode. parentNode.rowI ndex;
      var serials = document.getEle mentsByNames("h dnOrdersSerialN o");
      var mobiles = document.getEle mentsByNames("h dnOrdersMobileN o");
      if(row>4)
      alert("Serial: " + serials[row-5].value + "\t" + "Mobile: " + mobiles[row-5].value);
      else alert("Select the proper row");
      }
      [/code]

      Debasis Jana


      but how about when there are
      3 handsets 3 sims
      3 handsets 3 sims
      3 handsets 3 sims

      how will i paired it..

      Comment

      • dmjpro
        Top Contributor
        • Jan 2007
        • 2476

        #33
        Originally posted by smiley22
        but how about when there are
        3 handsets 3 sims
        3 handsets 3 sims
        3 handsets 3 sims

        how will i paired it..
        Means if the on 6th row it is clicked then first row will be populated.
        And if it is clicked on first row then, what?

        Debasis Jana

        Comment

        • smiley22
          New Member
          • Jun 2007
          • 54

          #34
          Originally posted by dmjpro
          Means if the on 6th row it is clicked then first row will be populated.
          And if it is clicked on first row then, what?

          Debasis Jana

          function only is placed in the sim part.. when you clicked the12th row
          the value wil be in 7th row, when you clicked the 18th row, the value will be in 13th row.

          Comment

          • dmjpro
            Top Contributor
            • Jan 2007
            • 2476

            #35
            Originally posted by smiley22
            function only is placed in the sim part.. when you clicked the12th row
            the value wil be in 7th row, when you clicked the 18th row, the value will be in 13th row.
            Yeah I did that.
            Hello ... Look at my code buddy.

            12-5=7
            13-5=8
            .
            .
            18-5=13

            Have a careful look.

            Debasis Jana

            Comment

            • smiley22
              New Member
              • Jun 2007
              • 54

              #36
              Originally posted by dmjpro
              Yeah I did that.
              Hello ... Look at my code buddy.

              12-5=7
              13-5=8
              .
              .
              18-5=13

              Have a careful look.

              Debasis Jana

              this code??what if row is >3?

              function getSerializedSi mLOV(obj)
              {
              var row = obj.parentNode. parentNode.rowI ndex;
              var serials = document.getEle mentsByNames("h dnOrdersSerialN o");
              var mobiles = document.getEle mentsByNames("h dnOrdersMobileN o");
              if(row>4)
              alert("Serial: " + serials[row-5].value + "\t" + "Mobile: " + mobiles[row-5].value);
              else alert("Select the proper row");
              }

              Comment

              • dmjpro
                Top Contributor
                • Jan 2007
                • 2476

                #37
                Originally posted by smiley22
                this code??what if row is >3?

                function getSerializedSi mLOV(obj)
                {
                var row = obj.parentNode. parentNode.rowI ndex;
                var serials = document.getEle mentsByNames("h dnOrdersSerialN o");
                var mobiles = document.getEle mentsByNames("h dnOrdersMobileN o");
                if(row>4)
                alert("Serial: " + serials[row-5].value + "\t" + "Mobile: " + mobiles[row-5].value);
                else alert("Select the proper row");
                }
                Ahh ... Let me clear one thing ....Smiley.
                Your click will start from 6th row, right?
                So if row clicked before 6th then it ll alert a message... "Select the proper row".
                Here the thing done !

                Debasis Jana

                Comment

                • smiley22
                  New Member
                  • Jun 2007
                  • 54

                  #38
                  Originally posted by dmjpro
                  Ahh ... Let me clear one thing ....Smiley.
                  Your click will start from 6th row, right?
                  So if row clicked before 6th then it ll alert a message... "Select the proper row".
                  Here the thing done !

                  Debasis Jana


                  Hi, i had came up with this code


                  [CODE=javascript]function getSerializedSi mLOV1(obj) {

                  var varQuantityValu e = document.crmFor m.txtQuan.value ;
                  varQuantityValu e = parseInt(varQua ntityValue);
                  var ctr = 0;
                  var varRowCount = document.getEle mentById('tblOr ders').rows.len gth;
                  var handsetCounter = 0;
                  var simCounter = 0;
                  var varTemp = 0;
                  var z = 0;

                  var row = obj.parentNode. parentNode.pare ntNode.parentNo de.parentNode.p arentNode.rowIn dex;
                  var mobiles = document.getEle mentsByName("hd nMIN");

                  if (varRowCount > 1) {
                  for (ctr = 0; ctr<varRowCount ; ctr++) {
                  var varMainCategory Code = document.crmFor m.hdnOrdersMain CategoryCode[z].value;

                  if (varMainCategor yCode == "HANDSET" ){
                  handsetCounter+ +;
                  }

                  z++;
                  }

                  varTemp = row - handsetCounter;

                  document.crmFor m.hdnMIN[varTemp].value = mobiles[row].value;
                  }
                  }
                  [/CODE]

                  this works for the first pair only,..

                  example:

                  when i add :

                  pair 1 - 1 handset 1sim
                  pair 2 - 1 handset 1 sim

                  pair 1 is good, it populate the pair handset 1
                  but when in pair 2, when i clicked sim 1 the value populated in pair 1 sim 1,
                  which should be in pair 2 handset 1....


                  Thanks for your help...
                  Last edited by acoder; Oct 15 '07, 01:57 PM. Reason: Added code tags

                  Comment

                  • dmjpro
                    Top Contributor
                    • Jan 2007
                    • 2476

                    #39
                    Well !

                    Please use Code tags.
                    Please explain me this code ..


                    [code=javascript]
                    if (varRowCount > 1) {
                    for (ctr = 0; ctr<varRowCount ; ctr++) {
                    var varMainCategory Code = document.crmFor m.hdnOrdersMain CategoryCode[z].value;

                    if (varMainCategor yCode == "HANDSET" ){
                    handsetCounter+ +;
                    }

                    z++;
                    }

                    varTemp = row - handsetCounter;
                    [/code]

                    What is the purpose of it?

                    Debasis Jana

                    Comment

                    • smiley22
                      New Member
                      • Jun 2007
                      • 54

                      #40
                      Originally posted by dmjpro
                      Well !

                      Please use Code tags.
                      Please explain me this code ..


                      [code=javascript]
                      if (varRowCount > 1) {
                      for (ctr = 0; ctr<varRowCount ; ctr++) {
                      var varMainCategory Code = document.crmFor m.hdnOrdersMain CategoryCode[z].value;

                      if (varMainCategor yCode == "HANDSET" ){
                      handsetCounter+ +;
                      }

                      z++;
                      }

                      varTemp = row - handsetCounter;
                      [/code]

                      What is the purpose of it?

                      Debasis Jana
                      to get the row where the auto populate value will be place.

                      Comment

                      • dmjpro
                        Top Contributor
                        • Jan 2007
                        • 2476

                        #41
                        Originally posted by smiley22
                        pair 1 is good, it populate the pair handset 1
                        but when in pair 2, when i clicked sim 1 the value populated in pair 1 sim 1,
                        which should be in pair 2 handset 1....
                        Actually I am not getting your point here.
                        Please explain me little bit more.

                        Debasis Jana.

                        Comment

                        • smiley22
                          New Member
                          • Jun 2007
                          • 54

                          #42
                          Originally posted by dmjpro
                          Actually I am not getting your point here.
                          Please explain me little bit more.

                          Debasis Jana.
                          hi there, i just finished my code, and my module is now working, thanks for your all great ideas, sorry if i become lazy along the way. i didn't think what you said..

                          Thanks again

                          Gudluck and regrds to all.. :)

                          Comment

                          • acoder
                            Recognized Expert MVP
                            • Nov 2006
                            • 16032

                            #43
                            smiley22, please use code tags in future when posting code.

                            &#91;CODE=javas cript]
                            JavaScript code goes here...
                            [/CODE]

                            Comment

                            Working...