Hallo leu,
Kennen jullie het tellertje van www.HotSMS.com wat het aantal karakters telt van het SMS bericht?
Nou, dat wil ik dus ook voor m'n gastenboek.
Nou heb ik al het een en ander "gejat" bij HotSMS maar op een of andere manier werkt het nog niet helemaal zoals het hoort.
Ik zal wel waar wat lulligs verkeerd doen. Kunnun jullie zo zien wat?
<head>
<script language="JavaScript">
<!--
function calcCharLeft(theForm)
{
var theReply = theForm.Relpy.value;
var availChars = 10;
if (theReply.length > availChars)
{
theForm.Reply.value = theReply.substring(0,availChars);
theForm.fChars.value = 0;
alert('Het ingetikte SMS-bericht is te lang en zal worden afgebroken.');
theForm.Reply.focus();
}
else
{
theForm.fChars.value = availChars - theReply.length;
}
} // calcCharLeft
-->
</script>
</head>
<body>
<form name="PostReply" method="post" action="SubmitReply.asp">
Naam:<input type="text" name="Naam">
Bericht:<textarea name="Reply" cols="50" rows="3" onkeypress="calcCharLeft(this.form)" onkeyup="calcCharLeft(this.form)" onkeydown="calcCharLeft(this.form)" onChange="calcCharLeft(this.form)"></textarea>
Aantal nog beschikbare tekens voor je bericht: input align="right" TYPE="text" NAME="fChars" SIZE="3" VALUE="118" disabled onfocus="this.form.Reply.focus()">
<input type="submit" value="Verstuur" >
</form>
Kennen jullie het tellertje van www.HotSMS.com wat het aantal karakters telt van het SMS bericht?
Nou, dat wil ik dus ook voor m'n gastenboek.
Nou heb ik al het een en ander "gejat" bij HotSMS maar op een of andere manier werkt het nog niet helemaal zoals het hoort.
Ik zal wel waar wat lulligs verkeerd doen. Kunnun jullie zo zien wat?
<head>
<script language="JavaScript">
<!--
function calcCharLeft(theForm)
{
var theReply = theForm.Relpy.value;
var availChars = 10;
if (theReply.length > availChars)
{
theForm.Reply.value = theReply.substring(0,availChars);
theForm.fChars.value = 0;
alert('Het ingetikte SMS-bericht is te lang en zal worden afgebroken.');
theForm.Reply.focus();
}
else
{
theForm.fChars.value = availChars - theReply.length;
}
} // calcCharLeft
-->
</script>
</head>
<body>
<form name="PostReply" method="post" action="SubmitReply.asp">
Naam:<input type="text" name="Naam">
Bericht:<textarea name="Reply" cols="50" rows="3" onkeypress="calcCharLeft(this.form)" onkeyup="calcCharLeft(this.form)" onkeydown="calcCharLeft(this.form)" onChange="calcCharLeft(this.form)"></textarea>
Aantal nog beschikbare tekens voor je bericht: input align="right" TYPE="text" NAME="fChars" SIZE="3" VALUE="118" disabled onfocus="this.form.Reply.focus()">
<input type="submit" value="Verstuur" >
</form>