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. asp net onfocus and onblur problem in ie6!

asp net onfocus and onblur problem in ie6!

Scheduled Pinned Locked Moved ASP.NET
helpjavascriptquestion
3 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.
  • N Offline
    N Offline
    Nyssa_20
    wrote on last edited by
    #1

    Hi, i have problem in ie6 with the onfocus event.The onblur and onfocus event execute some javascript code. The problem is , in mozzilla this work ok, in ie6 work only for some objects. Fe: for the companyname textbox the browser didnt apply this 2 events, the select object work fine. Can u help me in this problem? I add this event to my object fr5om code behind: in page load : .. Me.companyname.Attributes.Add("onFocus", "changehint('hint1',2)") Me.companyname.Attributes.Add("onBlur", "check_field('companyname',this.value,'hint1')") Me.state.Attributes.Add("onfocus", "changehint('hint4',2)") Me.state.Attributes.Add("onblur", "check_field('state',this.value,'hint4')") My aspx page looks like this ... The javascript code change hintbox style on onfocus or onblur event: function changehint(elem,type,label) { var hint = document.getElementById(elem); hint.style.visibility = "visible"; if (type == 1) {hint.className='hintForRegistration red';} else if (type == 2) {hint.className='hintForRegistration orange';} else if (type == 3) {hint.className='hintForRegistration blue'; hint.innertext = 'OKSA!';} } function check_field(thefield,thevalue,thehint) { if (thefield == "companyname" || thefield == "state" || thefield =="companystreet" || thefield =

    *

    *

    Baranya

    T 1 Reply Last reply
    0
    • N Nyssa_20

      Hi, i have problem in ie6 with the onfocus event.The onblur and onfocus event execute some javascript code. The problem is , in mozzilla this work ok, in ie6 work only for some objects. Fe: for the companyname textbox the browser didnt apply this 2 events, the select object work fine. Can u help me in this problem? I add this event to my object fr5om code behind: in page load : .. Me.companyname.Attributes.Add("onFocus", "changehint('hint1',2)") Me.companyname.Attributes.Add("onBlur", "check_field('companyname',this.value,'hint1')") Me.state.Attributes.Add("onfocus", "changehint('hint4',2)") Me.state.Attributes.Add("onblur", "check_field('state',this.value,'hint4')") My aspx page looks like this ... The javascript code change hintbox style on onfocus or onblur event: function changehint(elem,type,label) { var hint = document.getElementById(elem); hint.style.visibility = "visible"; if (type == 1) {hint.className='hintForRegistration red';} else if (type == 2) {hint.className='hintForRegistration orange';} else if (type == 3) {hint.className='hintForRegistration blue'; hint.innertext = 'OKSA!';} } function check_field(thefield,thevalue,thehint) { if (thefield == "companyname" || thefield == "state" || thefield =="companystreet" || thefield =

      *

      *

      Baranya

      T Offline
      T Offline
      t7bros
      wrote on last edited by
      #2

      If this is a direct copy of your code, your solution may be really simple: check casing when assigning the attributes to Me.CompanyName. You have "onFocus" in that control, but "onfocus" in the State control.

      Have faith in yourself; amateurs built the Ark, professionals built the Titanic.

      N 1 Reply Last reply
      0
      • T t7bros

        If this is a direct copy of your code, your solution may be really simple: check casing when assigning the attributes to Me.CompanyName. You have "onFocus" in that control, but "onfocus" in the State control.

        Have faith in yourself; amateurs built the Ark, professionals built the Titanic.

        N Offline
        N Offline
        Nyssa_20
        wrote on last edited by
        #3

        i try it but not work. The freaky thing is, when i make a save page as and i start the local copy in ie6, everything works fine. I must mention the page was saved in Ie6, so the generated code is the same. In developer toolbar the textbox doesnt have the onfocus and onblur event. thanks

        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