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. javascript doubt

javascript doubt

Scheduled Pinned Locked Moved ASP.NET
javascripthtmlsysadminhelp
8 Posts 6 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.
  • S Offline
    S Offline
    saravanan05
    wrote on last edited by
    #1

    function codename() { if(document.formname.checkboxname.checked) { document.formname.textname.disabled=false; } else { document.formname.textname.disabled=true; } }

    hi friens this is my javascript code with checkbox,button here i select checkbox the button is enabled and deselect it is disabled(it is working fine) now i am using html page (it is not working) i gave runat=server in html..(it is also not working) can u help me

    S R B C 4 Replies Last reply
    0
    • S saravanan05

      function codename() { if(document.formname.checkboxname.checked) { document.formname.textname.disabled=false; } else { document.formname.textname.disabled=true; } }

      hi friens this is my javascript code with checkbox,button here i select checkbox the button is enabled and deselect it is disabled(it is working fine) now i am using html page (it is not working) i gave runat=server in html..(it is also not working) can u help me

      S Offline
      S Offline
      Sylvester george
      wrote on last edited by
      #2

      if you are using runat=server for any control then defin the tag like in javascript method use like following document.getElementById("whateverID").checked

      Regards, Sylvester G sylvester_g_m@yahoo.com

      1 Reply Last reply
      0
      • S saravanan05

        function codename() { if(document.formname.checkboxname.checked) { document.formname.textname.disabled=false; } else { document.formname.textname.disabled=true; } }

        hi friens this is my javascript code with checkbox,button here i select checkbox the button is enabled and deselect it is disabled(it is working fine) now i am using html page (it is not working) i gave runat=server in html..(it is also not working) can u help me

        R Offline
        R Offline
        rreddy V
        wrote on last edited by
        #3

        If you use runat=server then the name will be changed better see in viewsource or/use document.getElementById(CustomerInfo").Checked or try this also document.forms[0]["checkbox1"].checked

        S 1 Reply Last reply
        0
        • R rreddy V

          If you use runat=server then the name will be changed better see in viewsource or/use document.getElementById(CustomerInfo").Checked or try this also document.forms[0]["checkbox1"].checked

          S Offline
          S Offline
          saravanan05
          wrote on last edited by
          #4

          hi it is not working if possible give the code.plz

          R 1 Reply Last reply
          0
          • S saravanan05

            hi it is not working if possible give the code.plz

            R Offline
            R Offline
            rreddy V
            wrote on last edited by
            #5

            function codename() { if(document.form[0][checkboxname].checked) { document.form[0][textname].disabled=false; } else { document.form[0][textname].disabled=true; } }

            1 Reply Last reply
            0
            • S saravanan05

              function codename() { if(document.formname.checkboxname.checked) { document.formname.textname.disabled=false; } else { document.formname.textname.disabled=true; } }

              hi friens this is my javascript code with checkbox,button here i select checkbox the button is enabled and deselect it is disabled(it is working fine) now i am using html page (it is not working) i gave runat=server in html..(it is also not working) can u help me

              B Offline
              B Offline
              badgrs
              wrote on last edited by
              #6

              What exactly isnt' working? Are you getting an error?

              1 Reply Last reply
              0
              • S saravanan05

                function codename() { if(document.formname.checkboxname.checked) { document.formname.textname.disabled=false; } else { document.formname.textname.disabled=true; } }

                hi friens this is my javascript code with checkbox,button here i select checkbox the button is enabled and deselect it is disabled(it is working fine) now i am using html page (it is not working) i gave runat=server in html..(it is also not working) can u help me

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

                If you use runat="server" you need to create javascript variables to hold the client side Id, which is represented by the ClientID property, and is not the Id you set on the server side.

                Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

                B 1 Reply Last reply
                0
                • C Christian Graus

                  If you use runat="server" you need to create javascript variables to hold the client side Id, which is represented by the ClientID property, and is not the Id you set on the server side.

                  Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

                  B Offline
                  B Offline
                  Bajrang Singh
                  wrote on last edited by
                  #8

                  Hi Christian Graus. So How can we get CientID of any server control?

                  Bajrang Singh Using .net 2.0 (VS2005)

                  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