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