can someone help me., and translate or generate this code javascript code in php..,
<html>
<head>
<title> </title>
</head>
<body>
<form name="my_form" method="post">
<textarea onKeyPress=check_length(my_form);
onKeyDown=check_length(my_form);
name="my_text"
rows=4 cols=30>
</textarea>
<input size=1 value=50 name=text_num> Characters Left
</form>
<script language=JavaScript>
function check_length(my_form){
maxLen = 50;
if ( my_form.my_text.value.length >= maxLen ) {
var msg = "You have reached your maximum limit of characters allowed";
alert(msg);
my_form.my_text.value = my_form.my_text.value.substring(0, maxLen);
}
else {
my_form.text_num.value = maxLen - my_form.my_text.value.length;
}
}
</script>
</body>
</html>