.change() not working in IE 7
Hi Guys,
Stuck with a small problem of .change() function not working in IE, i was going through some blogs which said the same thing, i tried using .click() without any help... i am attaching the code below... please help... the code is as follows
-
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript" src="jquery-1.3.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$(':input','#prefForm')
.not(':button, :submit, :reset, :hidden').attr("disabled", true);
$('#submitButton').hide();
$('#cancelButton').hide();
;
$('#EditButton').click(function(){
$(':input','#prefForm')
.not(':button, :submit, :reset, :hidden').attr("disabled", false);
$('#submitButton').show();
$('#cancelButton').show();
$('#EditButton').hide();
});
var somethingChanged = false;
$('#prefForm input, select').change(function() {
somethingChanged = true;
});
$('#cancelButton').click(function() {
if (somethingChanged == true) {
var cancelForm = confirm('Save or not');
return cancelForm;
}
else {
return true;
}
});
});
</script>
<title>Untitled Document</title>
</head>
<body>
<form action="save" id="prefForm" method="post" name="prefForm">
<label>Select Gender</label>
<select id="language" name="language" tabindex="30">
<option value="M">Male</option>
<option value="fr">French</option>
</select>
<label>Country:</label>
<select id="country" name="country" tabindex="30">
<option>Afghanistan</option>
<option>Albania</option>
<option>Algeria</option>
<option>American Samoa</option>
<option>Andorra</option>
<option>Angola</option>
</select>
<input type="radio" name="vehicle" value="true" />
<label>Car</label>
<input type="radio" name="vehicle" value="false" />
<label>Two Wheeler</label>
<input id="training" name="training" type="checkbox" />
<label>Send Mails</label>
<input checked="checked" id="hideTerms" name="hideTerms" type="checkbox" />
<label>Do not show Enable</label>
<input name="submitButton" id="submitButton" value="Submit" type="submit" />
<div id="cancelButtonRow"><a href="cancel" id="cancelButton" >
<div class="btnGrey" tabindex="110" title="Cancel" value="Cancel">Cancel</div></a>
<input class="btnGrey" id="EditButton" type="button" value="Edit" /></form>
</body>
</html>