galabin123
Registered
как да направя да ми показва оставащите символи за писане в textarea
Follow along with the video below to see how to install our site as a web app on your home screen.
Бележка: This feature may not be available in some browsers.
<?
function textCounter(field, countfield, maxlimit) {
/*
* The input parameters are: the field name;
* field that holds the number of characters remaining;
* the max. numb. of characters.
*/
if (field.value.length > maxlimit) // if the current length is more than allowed
field.value =field.value.substring(0, maxlimit); // don't allow further input
else
countfield.value = maxlimit - field.value.length;} // set the display field to remaining number
?>
<textarea name='com' id="com" class="ed" cols='70' rows='6' onkeydown="textCounter(this.form.message, this.form.remLen,100);"
onkeyup="textCounter(this.form.message, this.form.remLen,100); "><? echo "$logged[username],моля пишете на кирилица!"; ?>
</textarea><input name="remLen" type="text" id="remLen" value="100" size="3" maxlength="3" readonly /><br />
Това е javascript не phpfunction textCounter(field, countfield, maxlimit) {
/*
* The input parameters are: the field name;
* field that holds the number of characters remaining;
* the max. numb. of characters.
*/
if (field.value.length > maxlimit) // if the current length is more than allowed
field.value =field.value.substring(0, maxlimit); // don't allow further input
else
countfield.value = maxlimit - field.value.length;} // set the display field to remaining number
така<textarea name='com' id="com" class="ed" cols='70' rows='6' onkeydown="textCounter(this.form.com, this.form.remLen,100);"
onkeyup="textCounter(this.form.com, this.form.remLen,100); "><? echo "$logged[username],моля пишете на кирилица!"; ?>
</textarea><input name="remLen" type="text" id="remLen" value="100" size="3" maxlength="3" readonly /><br />