Web Analytics Made Easy -
StatCounter Error in function - CodingForum

Announcement

Collapse
No announcement yet.

Error in function

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Error in function

    Hey everyone. I have an ASP page that contains a form with a series of dynamically named text boxes. What I want to do is when the user changes the value in a text box, onBlur, call the below javascript function that passes a record ID and uses it to calculate the value of another text box.

    Here is the function:

    function doCFIS(ID){

    document.frmEdit.txtMFN+(ID).value = (document.frmEdit.txtGeoLoc+(ID).value + document.frmEdit.txtSubNum+(ID).value + document.frmEdit.txtSeqNum+(ID).value);
    }

    I am thinking the problem is the way I refer to the form text boxes. The function says txtMFN+(ID). So if the ID that was passed was 123 then the text box I want to populate would be txtMFN123. I am more of a vbScript guy than a Javascript guy. To me this should work. Can I NOT dynamically assemble a statement like I have above?

    Thanks in advance for any help.

    Shane

  • #2
    function doCFIS(ID){

    document.frmEdit['txtMFN'+ID].value = (document.frmEdit['txtGeoLoc'+ID].value + document.frmEdit['txtSubNum'+ID].value + document.frmEdit['txtSeqNum'+ID].value);
    }

    Comment


    • #3
      I am still getting an "error onpage" at the bottom left hand of my browser window. I'll continue to work on what you sent me. If you have any further suggestions that wold be great.

      Thanks for such a quick response!

      Shane

      Comment


      • #4
        you could try and say what the error says.

        Comment


        • #5
          Just that when the page comes up upon changing a value of a text box and hitting the tab key (triggering the onBlur) event the message "error on page" displays at the bottom left of the browser. Nothing else.

          Comment


          • #6
            double click on the ! icon on the status bar.. it will tell the exact error and the place where its occuring.
            Nobody is Perfect. I am Nobody.

            Comment


            • #7
              Here's more info on using the square bracket notation that Garadon used. You will find it very useful.
              Glenn
              vBulletin Mods That Rock!

              Comment

              Working...
              X