Reputation: 29
jQuery is not working in IE7 while it works properly in IE8 & above, chrome and Fire Fox. I spend time but didn't get any clue so I am here, need help.
JQuery is:
$("#<%= Txt_Destination.ClientID %>").val(window.sessionStorage.getItem("Destination"));
I used Session to take the value in text box from the previous form.
document.getElementById('<%=Txt_Destination.ClientID%>').readOnly = true; //made it Read Only.
var arr = new Array();
arr = Route.split(',');
$("#DDL_Route").html("");
$("#DDL_Route").append($("<option></option>").val(0).html("Select"));
for (var i = 0; i < arr.length; i++) {
var item = arr[i];
$("#DDL_Route").append($("<option></option>").val(i + 1).html(item));
}
It is used to have value in drop down from Route variable which has multiple values comma separated
$('#DDL_Route').change(function () {
var selectedvalue = $('#DDL_Route option:selected').attr('text');
if (selectedvalue == 'Select') {
alert('Please select value from dropdown');
$('#<%= HiddenField1.ClientID %>').val(" ");
return false;
} Validation.
$("#<%= Btn_Save.ClientID %>").click(function () {
var numericReg = /^[1-9][0-9]{9}$/; // check only digit
if (!numericReg.test($('#<%= Txt_Number.ClientID %>').val())) {
// if not digit, return false
alert("Please enter proepr contact no in Text Box");
return false;
}
else if ($('#<%= Txt_Number.ClientID %>').val() == "") { // if it is blank, return false
alert("Please enter 10 digit contact no in Text Box");
return false;
}
//if value is Select from drop down, return false else if ($('#<%= HiddenField1.ClientID %>').val() == " " || $('#DDL_Route option:selected').attr('text') == "Select") {
alert("Please select value from dropdown");
return false;
}
else { // all conditions satisfied, return true
return true;
}
}); Submit action with validation.
Can you anyone tell me what is the wrong here which is IE7 not supporting
Thanks in advance.
Upvotes: 0
Views: 193