3 Replies - 3584 Views - Last Post: 10 August 2012 - 03:29 PM

#1 amit.soni  Icon User is offline

  • D.I.C Head

Reputation: 26
  • View blog
  • Posts: 73
  • Joined: 19-November 10

why this script is not working in google chrome ?

Posted 06 August 2012 - 11:52 PM

Javascript :

<script type="text/javascript">
function monenableTextBox() {
            if (document.getElementById('<%=cb.ClientID%>').checked == true) {
                document.getElementById('<%=tb.ClientID%>').disabled = false;
            }
            else {
                document.getElementById('<%=tb.ClientID%>').disabled = true;
            }
        }

</script>



And ASPX
<asp:CheckBox ID="cb" runat="server" onchange="monenableTextBox()" />
<asp:TextBox ID="tb" Enabled="false" runat="server"></asp:TextBox>




this code is working fine on IE , Opera , Firefox..
but this code is not working in google chrome... :(

can someone tell me how to resolve this...

Thanks...

Is This A Good Question/Topic? 0
  • +

Replies To: why this script is not working in google chrome ?

#2 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6063
  • View blog
  • Posts: 23,515
  • Joined: 23-August 08

Re: why this script is not working in google chrome ?

Posted 07 August 2012 - 03:04 AM

What does "not working" mean? We're not standing there behind you, looking at your screen.
Was This Post Helpful? 0
  • +
  • -

#3 amit.soni  Icon User is offline

  • D.I.C Head

Reputation: 26
  • View blog
  • Posts: 73
  • Joined: 19-November 10

Re: why this script is not working in google chrome ?

Posted 08 August 2012 - 10:58 PM

View PostJackOfAllTrades, on 07 August 2012 - 03:04 AM, said:

What does "not working" mean? We're not standing there behind you, looking at your screen.




initially textbox is disable.. when u check the checkbox,the textbox will enable for typing in it.. and when we uncheck the checkbox the textbox will again disable... this works on IE9,Opera,FireFox but google chrome does nothing on check or uncheck..
Was This Post Helpful? 0
  • +
  • -

#4 kevin_911  Icon User is offline

  • D.I.C Head

Reputation: 4
  • View blog
  • Posts: 127
  • Joined: 02-April 09

Re: why this script is not working in google chrome ?

Posted 10 August 2012 - 03:29 PM

Have you tried 'inspect element' in chrome?

You can debug javascript in chrome by setting breakpoints and you can simply step into the code.

Have a read through this tutorial on how to set a breakpoints My link

Also you don't need an else statement, by default your textbox is disabled.

This post has been edited by kevin_911: 10 August 2012 - 03:32 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1