PatrickLewis
07-14-2004, 12:02 PM
Is there any way to the size in Kb of the value of a specific form element? Say, 10 lines of text in a textarea is 1.5k?
|
Click to See Complete Forum and Search --> : size of data in a form element PatrickLewis 07-14-2004, 12:02 PM Is there any way to the size in Kb of the value of a specific form element? Say, 10 lines of text in a textarea is 1.5k? Vladdy 07-14-2004, 12:33 PM <textarea name="myText" onkeyup="updateSize(this)"></textarea> <p>Size of text: <span id="textSize">0</span> kB</p> <script type="text/javascript"> function updateSize(ta) { document.getElementById('textSize').firstChild.nodeValue = 0.001*ta.value.length; } </script> webdeveloper.com
Copyright Internet.com Inc., All Rights Reserved. |