This is what I did to fix this problem:
I still used this javascript
<script>
$(document).ready(function(){
$("#password2").keypress(function (e) {
setEnterValue(e);
});
});
function setEnterValue(e) {
var key = checkBrowser(e);
if (key == 13) {
$("#btnChanged").click();
}
}
function checkBrowser(e) {
if (window.event)
key = window.event.keyCode;
else
key = e.which;
return key;
}
</script>
but...
I put my button and my textbox inside of a
<asp:panel runat="server" defaultbutton="btnChanged" xmlns:asp="#unknown">my button and text box </asp:panel>
and set the DefaultButton to the id of my button
This problem had nothing to do with browsers that didnt have javascript activated, as other javascript code in my website worked on the browser at the same time that i tried to run this code.
I hope that this will help someone