Thanks Greg, got it working, that's a great little one! :-)


-----Original Message-----
From: Greg Luce [mailto:[EMAIL PROTECTED]
Sent: 23 February 2004 18:47
To: CF-Talk
Subject: RE: TextArea woes


This is clean.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<title>TextArea Character Count Example</title>
<link rel="STYLESHEET" href="" type="text/css">
<script language="_javascript_"><!--
  maxKeys = 50;
  var IE = (document.all) ? 1 : 0;
  var DOM = 0;
  if (parseInt(navigator.appVersion) >=5) {DOM=1};
    function txtshow( txt2show ) {
  // Detect Browser
  if (DOM) {
    var viewer = document.getElementById("txtmsg");
        viewer.innerHTML=txt2show;
    }
  else if(IE) { document.all["txtmsg"].innerHTML=txt2show; }
  }
function keyup(what)
{
  var str = new String(what.value);
  var len = str.length;
  var showstr = len + " characters of " + maxKeys + " entered";
  if (len > maxKeys) showstr += '<br>Some information will be lost,
please revise your entry';
  txtshow( showstr );
}
//-->
</script>
</head>

<body bgcolor="#ffffff">
<h1>Count the Characters in a Text Area Example</h1>
<table width="100%">
<tr><!-- Start of Example -->
<td valign="top">Enter Text into the box below.<br>
<table width="100%">
<tr>
<td><form><textarea cols="40"
rows="5" > <td valign="top"><div
id="txtmsg">&nbsp;</div></td>
</tr>
</table><!-- End of Example -->
&nbsp;<br>
    </td>
<td valign="top" rowspan="3"><p>&nbsp;</p></td>
    <td>&nbsp;</td>
  </tr>
</table>
</body>

</html>

-----Original Message-----
From: Stuart Kidd [mailto:[EMAIL PROTECTED]
Sent: Monday, February 23, 2004 1:30 PM
To: CF-Talk
Subject: TextArea woes

Hi guys,

I remember seeing a page once in the past where the <textarea> had a
countdown.  I want users to only type in 120 characters but it would be
nice for them to see the amount of characters they have left to use
dynanically changing.

This will be used for text messaging (120 characters for the user and
then 40 for a footer that I'll use with standard info).

If anyone knows a way of doing this please notify.

Thanks,

Stuart
  _____
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to