didn't we have it in here? Can'T find it now, am in a hurry...
just tried a little with JS, would want to have the chars counting back within a separate text-input ... alas n54 don't have a
name for their post-form, it is an id (
) so no success with n54.
But I'm happy to have it get working on another place of mine where I'm able to name the forms and textareas myself
char-counter in action
Here's the script I used for it, hope I've posted all necessary:
Quote: <!-- // Start SMS -->
<script language="javascript">
<!-- //char-counter
var formfeld="";
var maxlang=5000;
function recount()
{
if (window.document.smsform.message.value.length>5000)
{
window.document.smsform.message.value=formfeld;
return;
}
else
{
formfeld=window.document.smsform.message.value;
window.document.smsform.showchars.value=maxlang-window.document.smsform.message.value.length;
}
}
//-->
</script>
<form action="/" method="post" name="smsform">
<textarea name="message" onKeyUp="javascript:recount()" rows="5" cols="40" wrap="virtual" style="background-color:black; border-color:848200;" onFocus="this.style.backgroundColor='#840000'" onBlur="this.style.backgroundColor='#000000'">
</textarea> <br>
Chars left: <input type="text" value="5000" name="showchars" size="5"> |
<br>
</form>
|
(I like the encoder-converter.. yapp)
greetz ed
my Index, Forum and Network54 Tutorials