|
|
|
| Нужно сделать что бы в textarea было сразу 2 функции. Когда подключаю 1 функцию другая пропадает. :( что делать. Помогите.
<textarea cols=50 rows=20 id="myTextArea"></textarea>
<script>
var maxlength = 100;
var myTextArea = document.getElementById("myTextArea");
function fixLength() {
myTextArea.value = myTextArea.value.substr(0, maxlength);
}
myTextArea.onkeyup = myTextArea.onchange = fixLength;
</script>
|
и
<textarea onkeyup="document.getElementById ('count').value = this.value.length"
name="text" cols="67" rows="8"></textarea>
Всего набрано<input readonly="readonly" style="border:0px; font-size:12px; text-align:center" id="count" size="1"> символа(ов).
|
| |
|
|
|
|
|
|
|
для: Doorgen
(26.12.2008 в 22:53)
| |
<script>
var maxlength = 100;
function fixLength(myTextArea) {
myTextArea.value = myTextArea.value.substr(0, maxlength);
document.getElementById('count').value = myTextArea.value.length;
}
</script>
<textarea id="myTextArea" onkeyup ="fixLength(this)"
name="text" cols="67" rows="8"></textarea>
<br/>Всего набрано
<input readonly="readonly" style="border:0px; font-size:105%; text-align:center" id="count" size="3">
символа(ов).
|
наверное просто нужно всё перетащить в функцию | |
|
|
|
|
|
|
|
для: xx77
(27.12.2008 в 11:05)
| | Спасибо тебе человек. | |
|
|
|
|
|
|
|
для: Doorgen
(27.12.2008 в 12:26)
| | xD | |
|
|
|