Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Working with IE7 not in Firefox

Working with IE7 not in Firefox

Scheduled Pinned Locked Moved ASP.NET
javascripthtmlhelpannouncement
7 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    MSinha
    wrote on last edited by
    #1

    Hi, I am using a javascript onclick function to get values of an input button. Then I am using webservices to input the value in table. This is working fine with IE7,IE6. But not working for Firefox. Part of the code is given below: function SegmentUpdate(okButton) { // Get a refence to the containing cell, it's up a few levels in the DOM var containingCell = okButton.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode; cancelButtonName = okButton.name.replace('OkButton', 'CancelButton'); cancelButton = document.getElementById(cancelButtonName); // Get the necessary Id's (They are written on the table data element for this cell). var segmentId = containingCell.sourceSegmentId; // Here the problem is. containingCell not accepting value in the variable segmentId. var userId = containingCell.userId; var languageCode = containingCell.languageCode; var milestoneName = containingCell.milestoneName; var contextualLevel = containingCell.contextualLevel; var isArchived = containingCell.isArchived; // Get a reference to the relative form elements (Their names are written on the table data element for this cell). var txtTQMReasonClientId = document.getElementById(containingCell.txtTQMReasonClientId); var ddlTQMReasonClientId = document.getElementById(containingCell.ddlTQMReasonClientId); divTargetTextClientId = document.getElementById(containingCell.divTargetTextClientId); txtOverrideTranslatedTextClientId = document.getElementById(containingCell.txtOverrideTranslatedTextClientId); txtOverrideTranslatedTextClientId = document.getElementById(containingCell.txtOverrideTranslatedTextClientId); divPanel2ClientId = document.getElementById(containingCell.divPanel2ClientId); panel1Id = containingCell.divPanel2ClientId; // Get the values from the form elements to make the update var reason = ""; if (txtTQMReasonClientId != null) { reason = txtTQMReasonClientId.value; } var reasonId = -1; if (ddlTQMReasonClientId != null) { reasonId = ddlTQMReasonClientId.value; } var overrideText = ""; if (txtOverrideTranslatedTextClientId != null) { overrideText = txtOverrideTranslatedTextClientId.value.trim(); } ABCD.WebServices.Approval.OverRideTargetSegmentText(segmentId, userId, overrideText, reasonId, reason, languageCode, milestoneName, contextualLevel, isArchived.toLowerCase(

    N N 2 Replies Last reply
    0
    • M MSinha

      Hi, I am using a javascript onclick function to get values of an input button. Then I am using webservices to input the value in table. This is working fine with IE7,IE6. But not working for Firefox. Part of the code is given below: function SegmentUpdate(okButton) { // Get a refence to the containing cell, it's up a few levels in the DOM var containingCell = okButton.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode; cancelButtonName = okButton.name.replace('OkButton', 'CancelButton'); cancelButton = document.getElementById(cancelButtonName); // Get the necessary Id's (They are written on the table data element for this cell). var segmentId = containingCell.sourceSegmentId; // Here the problem is. containingCell not accepting value in the variable segmentId. var userId = containingCell.userId; var languageCode = containingCell.languageCode; var milestoneName = containingCell.milestoneName; var contextualLevel = containingCell.contextualLevel; var isArchived = containingCell.isArchived; // Get a reference to the relative form elements (Their names are written on the table data element for this cell). var txtTQMReasonClientId = document.getElementById(containingCell.txtTQMReasonClientId); var ddlTQMReasonClientId = document.getElementById(containingCell.ddlTQMReasonClientId); divTargetTextClientId = document.getElementById(containingCell.divTargetTextClientId); txtOverrideTranslatedTextClientId = document.getElementById(containingCell.txtOverrideTranslatedTextClientId); txtOverrideTranslatedTextClientId = document.getElementById(containingCell.txtOverrideTranslatedTextClientId); divPanel2ClientId = document.getElementById(containingCell.divPanel2ClientId); panel1Id = containingCell.divPanel2ClientId; // Get the values from the form elements to make the update var reason = ""; if (txtTQMReasonClientId != null) { reason = txtTQMReasonClientId.value; } var reasonId = -1; if (ddlTQMReasonClientId != null) { reasonId = ddlTQMReasonClientId.value; } var overrideText = ""; if (txtOverrideTranslatedTextClientId != null) { overrideText = txtOverrideTranslatedTextClientId.value.trim(); } ABCD.WebServices.Approval.OverRideTargetSegmentText(segmentId, userId, overrideText, reasonId, reason, languageCode, milestoneName, contextualLevel, isArchived.toLowerCase(

      N Offline
      N Offline
      newc1
      wrote on last edited by
      #2

      Do you know at what point your script is falling over (does it error or does it simply not update the DB)? Are your variables being populated before the web service call is made?

      Clean code is the key to happiness.

      M 1 Reply Last reply
      0
      • M MSinha

        Hi, I am using a javascript onclick function to get values of an input button. Then I am using webservices to input the value in table. This is working fine with IE7,IE6. But not working for Firefox. Part of the code is given below: function SegmentUpdate(okButton) { // Get a refence to the containing cell, it's up a few levels in the DOM var containingCell = okButton.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode; cancelButtonName = okButton.name.replace('OkButton', 'CancelButton'); cancelButton = document.getElementById(cancelButtonName); // Get the necessary Id's (They are written on the table data element for this cell). var segmentId = containingCell.sourceSegmentId; // Here the problem is. containingCell not accepting value in the variable segmentId. var userId = containingCell.userId; var languageCode = containingCell.languageCode; var milestoneName = containingCell.milestoneName; var contextualLevel = containingCell.contextualLevel; var isArchived = containingCell.isArchived; // Get a reference to the relative form elements (Their names are written on the table data element for this cell). var txtTQMReasonClientId = document.getElementById(containingCell.txtTQMReasonClientId); var ddlTQMReasonClientId = document.getElementById(containingCell.ddlTQMReasonClientId); divTargetTextClientId = document.getElementById(containingCell.divTargetTextClientId); txtOverrideTranslatedTextClientId = document.getElementById(containingCell.txtOverrideTranslatedTextClientId); txtOverrideTranslatedTextClientId = document.getElementById(containingCell.txtOverrideTranslatedTextClientId); divPanel2ClientId = document.getElementById(containingCell.divPanel2ClientId); panel1Id = containingCell.divPanel2ClientId; // Get the values from the form elements to make the update var reason = ""; if (txtTQMReasonClientId != null) { reason = txtTQMReasonClientId.value; } var reasonId = -1; if (ddlTQMReasonClientId != null) { reasonId = ddlTQMReasonClientId.value; } var overrideText = ""; if (txtOverrideTranslatedTextClientId != null) { overrideText = txtOverrideTranslatedTextClientId.value.trim(); } ABCD.WebServices.Approval.OverRideTargetSegmentText(segmentId, userId, overrideText, reasonId, reason, languageCode, milestoneName, contextualLevel, isArchived.toLowerCase(

        N Offline
        N Offline
        Not Active
        wrote on last edited by
        #3

        okButton.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode; That's a hell of a lot of parentNode references. Far to many. At what point does the script fail? What is the error message?


        only two letters away from being an asset

        M 1 Reply Last reply
        0
        • N newc1

          Do you know at what point your script is falling over (does it error or does it simply not update the DB)? Are your variables being populated before the web service call is made?

          Clean code is the key to happiness.

          M Offline
          M Offline
          MSinha
          wrote on last edited by
          #4

          This is error and hence not updating DB. No the variables are not populating. The error is with containingCell. This is not extracting related values.

          1 Reply Last reply
          0
          • N Not Active

            okButton.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode; That's a hell of a lot of parentNode references. Far to many. At what point does the script fail? What is the error message?


            only two letters away from being an asset

            M Offline
            M Offline
            MSinha
            wrote on last edited by
            #5

            Yes you are right-a lot of parentNode references. But I have 11 variables to populate, this is why 11 times this is written. I have taken only 1 parentNode, but this has given me undefined for the variables. [I have used alert(variables).] The script is ok for IE. But using Mozilla Firefox. This gives above error on the same point "undefined". Hence, not populating variables and the DB. Either "parentNode" not accepting or I miss the syntax. Please help me to solve this problem.

            N 1 Reply Last reply
            0
            • M MSinha

              Yes you are right-a lot of parentNode references. But I have 11 variables to populate, this is why 11 times this is written. I have taken only 1 parentNode, but this has given me undefined for the variables. [I have used alert(variables).] The script is ok for IE. But using Mozilla Firefox. This gives above error on the same point "undefined". Hence, not populating variables and the DB. Either "parentNode" not accepting or I miss the syntax. Please help me to solve this problem.

              N Offline
              N Offline
              Not Active
              wrote on last edited by
              #6

              MSinha wrote:

              I have taken only 1 parentNode

              okButton.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode; Well of course there is only one parentNode for each object. However, it looks like you 11 levels deep. At that point you should just go directly to the element you are trying to get to, document.getElementById();

              MSinha wrote:

              [I have used alert(variables).]

              How about debugging in a more professional manner, like using a debugger. Alert is not a diagnostic tool.


              only two letters away from being an asset

              M 1 Reply Last reply
              0
              • N Not Active

                MSinha wrote:

                I have taken only 1 parentNode

                okButton.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode; Well of course there is only one parentNode for each object. However, it looks like you 11 levels deep. At that point you should just go directly to the element you are trying to get to, document.getElementById();

                MSinha wrote:

                [I have used alert(variables).]

                How about debugging in a more professional manner, like using a debugger. Alert is not a diagnostic tool.


                only two letters away from being an asset

                M Offline
                M Offline
                MSinha
                wrote on last edited by
                #7

                var segmentId = document.getElementById(containingCell.sourceSegmentId); Using above, I gets null for the variable segmentId both in in IE7 and Mozilla Firefox. The version for FF is:(Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11). Please help me.

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups