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. Help in Java script

Help in Java script

Scheduled Pinned Locked Moved ASP.NET
csshelpjavajavascripttools
9 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.
  • A Offline
    A Offline
    AprNgp
    wrote on last edited by
    #1

    I have a gridview control, which contains multiple rows. Each row has a link-button and a detailsview control. Using the link-button, i want to show or hide the detailsview control. Initially all the details view have their css property Display=None set. If the link button in any of the grid-view row is clicked, i want a java-script to make the details -view in that row visible (Display=Block) So i wrote the following javascript:

    While showing the details-view control, it shows momentarily, and again become invisible automatically ...
    What could be the problem ...

    <div class="ForumSig"><i>Apurv</i>

    “Never trust a computer you can’t throw out a window.”
    (Steve Wozniak)

    “There are only two industries that refer to their customers as ‘users’.”
    (Edward Tufte)</div></x-turndown>

    C A 2 Replies Last reply
    0
    • A AprNgp

      I have a gridview control, which contains multiple rows. Each row has a link-button and a detailsview control. Using the link-button, i want to show or hide the detailsview control. Initially all the details view have their css property Display=None set. If the link button in any of the grid-view row is clicked, i want a java-script to make the details -view in that row visible (Display=Block) So i wrote the following javascript:

      While showing the details-view control, it shows momentarily, and again become invisible automatically ...
      What could be the problem ...

      <div class="ForumSig"><i>Apurv</i>

      “Never trust a computer you can’t throw out a window.”
      (Steve Wozniak)

      “There are only two industries that refer to their customers as ‘users’.”
      (Edward Tufte)</div></x-turndown>

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      The script looks fine. I assume your code is calling the show and then the hide script right away.

      Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

      A 1 Reply Last reply
      0
      • C Christian Graus

        The script looks fine. I assume your code is calling the show and then the hide script right away.

        Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

        A Offline
        A Offline
        AprNgp
        wrote on last edited by
        #3

        do i need to add the return; statement at the end ... ?

        Apurv “Never trust a computer you can’t throw out a window.” (Steve Wozniak) “There are only two industries that refer to their customers as ‘users’.” (Edward Tufte)

        C 1 Reply Last reply
        0
        • A AprNgp

          do i need to add the return; statement at the end ... ?

          Apurv “Never trust a computer you can’t throw out a window.” (Steve Wozniak) “There are only two industries that refer to their customers as ‘users’.” (Edward Tufte)

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          Depends where you mean. I'm yet to see what code calls these methods, returning a true or false from these methods may stop the other events from triggering, but I can't say, because you've not posted the code that is relevant. your code has no bugs that I can see, it's just being called in ways you don't expect.

          Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

          1 Reply Last reply
          0
          • A AprNgp

            I have a gridview control, which contains multiple rows. Each row has a link-button and a detailsview control. Using the link-button, i want to show or hide the detailsview control. Initially all the details view have their css property Display=None set. If the link button in any of the grid-view row is clicked, i want a java-script to make the details -view in that row visible (Display=Block) So i wrote the following javascript:

            While showing the details-view control, it shows momentarily, and again become invisible automatically ...
            What could be the problem ...

            <div class="ForumSig"><i>Apurv</i>

            “Never trust a computer you can’t throw out a window.”
            (Steve Wozniak)

            “There are only two industries that refer to their customers as ‘users’.”
            (Edward Tufte)</div></x-turndown>

            A Offline
            A Offline
            Abhishek Sur
            wrote on last edited by
            #5

            Replace your code with this ...

            function ShowReplyBox(PMBox) {
            var myElement = document.getElementById(PMBox);
            if (!myElement){
            alert('element not found');
            return;
            }
            if(myElement.style.display != "block")
            myElement.style.display = "block";
            }
            function HideReplyBox(PMBox) {
            var myElement = document.getElementById(PMBox);
            if (!myElement){
            alert('element not found');
            return;
            }
            if(myElement.style.display != "none")
            myElement.style.display = "none";
            }

            :cool::cool:

            Abhishek Sur


            My Latest Articles **Create CLR objects in SQL Server 2005 C# Uncommon Keywords Read/Write Excel using OleDB

            **Don't forget to click "Good Answer" if you like to.

            C 1 Reply Last reply
            0
            • A Abhishek Sur

              Replace your code with this ...

              function ShowReplyBox(PMBox) {
              var myElement = document.getElementById(PMBox);
              if (!myElement){
              alert('element not found');
              return;
              }
              if(myElement.style.display != "block")
              myElement.style.display = "block";
              }
              function HideReplyBox(PMBox) {
              var myElement = document.getElementById(PMBox);
              if (!myElement){
              alert('element not found');
              return;
              }
              if(myElement.style.display != "none")
              myElement.style.display = "none";
              }

              :cool::cool:

              Abhishek Sur


              My Latest Articles **Create CLR objects in SQL Server 2005 C# Uncommon Keywords Read/Write Excel using OleDB

              **Don't forget to click "Good Answer" if you like to.

              C Offline
              C Offline
              Christian Graus
              wrote on last edited by
              #6

              Would setting the display to block if it already is, cause it to disappear ?

              Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

              A 1 Reply Last reply
              0
              • C Christian Graus

                Would setting the display to block if it already is, cause it to disappear ?

                Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

                A Offline
                A Offline
                Abhishek Sur
                wrote on last edited by
                #7

                No. I dont think so. if I set display = "" it will act similar to display="block" I dont know what is wrong with his code... Might be his code calling the display="none" just after setting display="block" :cool:

                Abhishek Sur


                My Latest Articles **Create CLR objects in SQL Server 2005 C# Uncommon Keywords Read/Write Excel using OleDB

                **Don't forget to click "Good Answer" if you like to.

                C 1 Reply Last reply
                0
                • A Abhishek Sur

                  No. I dont think so. if I set display = "" it will act similar to display="block" I dont know what is wrong with his code... Might be his code calling the display="none" just after setting display="block" :cool:

                  Abhishek Sur


                  My Latest Articles **Create CLR objects in SQL Server 2005 C# Uncommon Keywords Read/Write Excel using OleDB

                  **Don't forget to click "Good Answer" if you like to.

                  C Offline
                  C Offline
                  Christian Graus
                  wrote on last edited by
                  #8

                  Yeah, the problem has to be that his code is calling both methods. Funny how people ask for help, then don't answer with the details you need to help them

                  Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

                  A 1 Reply Last reply
                  0
                  • C Christian Graus

                    Yeah, the problem has to be that his code is calling both methods. Funny how people ask for help, then don't answer with the details you need to help them

                    Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

                    A Offline
                    A Offline
                    Abhishek Sur
                    wrote on last edited by
                    #9

                    Yes. you are right.. :laugh: :rose:

                    Abhishek Sur


                    My Latest Articles **Create CLR objects in SQL Server 2005 C# Uncommon Keywords Read/Write Excel using OleDB

                    **Don't forget to click "Good Answer" if you like to.

                    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