View Single Post
Old 10-03-2012, 02:00 AM   PM User | #2
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,236
Thanks: 59
Thanked 3,997 Times in 3,966 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
Actually, it balks even at the leading digit in the name.

If you won't follow normal naming rules for form fields you have to
(1) Ensure that you put "..." around the entire name.
(2) Use form["..."] in the JS code to refer to the field.

BUT...

But you really never needed to refer to THAT <textarea> by name in that JS code, in the first place.

Just do this:
Code:
<textarea name="5)MIN:TXT:message"
         onkeydown="limitText(this,this.form.countdown,10);"
         onkeyup  ="limitText(this,this.form.countdown,10);"
><?php echo $value[5];?></textarea>
Notice carefully the quotes around the field name.
Notice that just this alone specifies the current field! nothing else needed.

Stop using PHP to output complex HTML. Do as I show there: Output the HTML, yes, and then only use the minimal PHP needed to output the contents.

Oh...and upper case letters in event handler names is obsolete. onkeyup and onkeydown are correct.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote