Showing posts with label Mozilla. Show all posts
Showing posts with label Mozilla. Show all posts

ASP.NET Checkbox click on label calling click event twice in JQuery

I don't know this is a known issue in Mozilla Firefox browser. When I use ASP.NET checkbox on a web page, it will render as a input control plus label. So, when I click on checkbox or label the click event raises and checkbox  state changes. But, I figured out  a strange behavior. When I click on the label the click event is raising twice when I use JQuery [I didn't try with  javascript]. But, where as when I click on checkbox it is raising click event only once. How to solve this problem? I have tried so many ways to solve the problem. But, didn't success.
I have tried by using type of the control. If type is checkbox then only go inside or just do nothing. When I click on label, it is coming to click event and every time, all lines are executing. I don't know why this is happening. Wheat I understood is, when we click on label then internally it is again generating click event for the checkbox because of the label for attribute. So, take care of it.
And if you find any solution to this problem, please let me know. Read More...

Fixing the error Permission denied to get property XULElement.selectedIndex in Mozilla Firefox

When working with Mozilla Firefox browser, I usually come across the error below many times.

Usual exception details: Permission denied to get property XULElement.selectedIndex

Error because of my own javascript function:
Permission denied to get property XULElement.popupOpen

I want to write this post because, for me it took long time to solve the issue. May be most of the people may get this error when working with Mozilla Firefox.

Why it is coming? What are the possibilities?

This will come if you are making AJAX calls with a input type text box, then firebug will throw this error. This is because it is a autocomplete functionality. To fix this what you need to do is, just add an attribute to input control as shown below.

<input type="text" autocomplete="off" />

This will stop Firefox from attempting to complete the content in the box.

That's it!!!

Is this helpful?

Read More...

mozilla frefox enter button problem in asp.net.

i am facing a small problem, which ate my mind almost 10 hours.
Introduction:
I am using Updatepanel [Ajax] in my site. According to my client specification, in which panel or div cursor focus on, when he/her press enter, the corresponding panel button click event will fire and request goes to server and gives response.
i am using control on my pages, because it has the property called DefaultButton. So, this will work perfectly for me if and only if, user browse my site in IE. then what about Mozilla?
Here my problem starts…
Problem:
1. The DefaultButton property of the Panel/Form won’t work in Mozilla when you hit enter key, when all these panels are reside in UpdatePanel control.
2. When any one press Enter button, it should check for validation if any input controls are there in that panel.
Solution:
After a long research i wrote small java script function to solve the problem.
OnClientClick=”setDefaultButton(this.name);
Java script function:
function setDefaultButton(name)
{
Page_ClientValidate();
if(document.all)
{}
else
{
if(!Page_IsValid)
__doPostBack(name,"");
}
}
if you have any issues with my code, please let me know. Read More...
Related Posts with Thumbnails
GiF Pictures, Images and Photos