[jQuery] Why keyCode into keyup event is disable

[jQuery] Why keyCode into keyup event is disable


I'm trying to use the folowing code
<!-- -------------------
HTML botom of the page
-------------------- -->
<script>initform()</script>
/*******
Javascript
*******/
function initform() {
// To find every input field into myform and attach mykeyupfct
$("input[@type='password']:visible,input
[@type='text']:visible").attr("id",function(){
$(this).keyup(function() {mykeyupfct(this);});
})
}
function mykeyupfct(myfield) {
var sid="#"+myfield.id
var skey
$(sid).keyup(function(e) {
skey = e.charCode ? e.charCode : e.keyCode ? e.keyCode : 0;
alert("never alert : " + skey);
});
alert("always alert but no skey for "+sid);
}
Im also tryinng :
$(sid).bind('keyup', function(e) {skey=e.keyCode; alert(skey); })
but it's the same problem
Thank's a lot for your help
A beginner jQuery
Soledad






























    • Topic Participants

    • josh