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. Onkeydown event in javascript not working in firefox3.0

Onkeydown event in javascript not working in firefox3.0

Scheduled Pinned Locked Moved ASP.NET
javascriptsysadminhelpquestion
2 Posts 2 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
    megivimal
    wrote on last edited by
    #1

    hi, The following code is not working in firefox3.0 but it's working fine in firefox2.0 what's the prb? any one plz help me..... <asp:TextBox ID="txtBirthdate" CssClass="date_box" runat="server" TabIndex="3" onkeydown="OnTextChange('ctl00$ContentPlaceHolder1$btnSubmit');" onchange="OnTextChange('ctl00$ContentPlaceHolder1$btnSubmit');"></asp:TextBox> <asp:Button ID="btnSubmit" Enabled="false" runat="server" CssClass="button" Text="Save" TabIndex="16" ValidationGroup="ValPatient_Detail" OnClick="btnSubmit_Click" /> function OnTextChange(Button) { if(navigator.appName!="Netscape") { document.getElementById(Button).disabled=false; } else { document.getElementById(Button).disabled=false; } } Button-->> value is btnSubmit

    G 1 Reply Last reply
    0
    • M megivimal

      hi, The following code is not working in firefox3.0 but it's working fine in firefox2.0 what's the prb? any one plz help me..... <asp:TextBox ID="txtBirthdate" CssClass="date_box" runat="server" TabIndex="3" onkeydown="OnTextChange('ctl00$ContentPlaceHolder1$btnSubmit');" onchange="OnTextChange('ctl00$ContentPlaceHolder1$btnSubmit');"></asp:TextBox> <asp:Button ID="btnSubmit" Enabled="false" runat="server" CssClass="button" Text="Save" TabIndex="16" ValidationGroup="ValPatient_Detail" OnClick="btnSubmit_Click" /> function OnTextChange(Button) { if(navigator.appName!="Netscape") { document.getElementById(Button).disabled=false; } else { document.getElementById(Button).disabled=false; } } Button-->> value is btnSubmit

      G Offline
      G Offline
      Greg Chelstowski
      wrote on last edited by
      #2

      Far as I'm concerned, using the document.getElementById function requires the ClientId as parameter, and not the name. ctl00$ContentPlaceHolder1$btnSubmit looks more like a name, the Id would probably be ctl00_ContentPlaceHolder1_btnSubmit. To avoid confusion (and really, not try to guess what a ClientId is going to be I would use:

      [...]
      onkeydown="OnTextChange('<%=btnSubmit.ClientID%>')"
      [...]

      var question = (_2b || !(_2b));

      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