Please can you help me, i don´t find a solution. I have a function with arguments and want to pass this function to a jquery bind-event:
function countChars23 (chars) {
var thi = $(this);
var len = $(this).val();
if (len.length >= chars) {
len = len.substring(0, 22);
thi.val(len);
}
}
Calling the function don´t work:
$('#name').bind('keyup', countChars23(10));
This don´t work either:
$('#name').bind('keyup', function() {
countChars23(10);
}
This don´t work either:
$('#name').keyup(function() {
countChars23(10);
}
Many Thanks for your help!