Asp.Net 4.5
Application has Textbox's with Minimum and Maximum values programmatically calculated on postback (server side), I call the js function from server code if it exceeds the limit. Works great in Chrome, FF. But in IE it freezes for approx. 2 minutes after user clicks [Ok] on the alert box. After about 2 minutes it allows the user to start making entries again. If I comment out the alert box then it works fine in IE. Any idea what would cause this only in IE?
Server side call to JS
If sender IsNot Nothing And TypeOf sender Is TextBox Then
CType(sender, TextBox).Attributes.Add("onblur", "MinMaxBlurServer(this," & min & "," & max & ");")
End If
JavaScript Function
function MinMaxBlurServer(obj, hfmin, hfmax) {
var txt = document.getElementById(obj.id);
var val = txt.value;
var m = document.getElementById("MainContent_minmaxpanel");
m.style.display = 'none';
if (isNumber(val) == "") {
if (val != "") {
//alert("Invalid enery. You must enter a numeric value!");
txt.value = "";
}
} else {
if (isNumber(hfmin)) {
if (parseFloat(val) < parseFloat(hfmin)) {
//alert("Value cannot be less than " + hfmin + ".");
txt.value = hfmin;
}
}
if (isNumber(hfmax)) {
if (parseFloat(val) > parseFloat(hfmax)) {
//alert("Value cannot be greater than " + hfmax + ".");
txt.value = hfmax;
}
}
}
}
function isNumber(n) {
return !isNaN(parseFloat(n)) && isFinite(n);
}
Aucun commentaire:
Enregistrer un commentaire