Richard
>>

I've got an input field that I want to restrict users to only being
able to post as much as will fit into the field without scrolling
(approx. 500 chars). I can set the field to a max. chars of 500, but
this doesn't take into account line breaks, which allow the user to
write much less than 500 chars, but still extend past the visible box.
>>
Try this

textField.onChanged = function() {
        while (this.maxscroll>1) {
        this.text = this.text.substr(0, -1);
        }
}

textField.onScroller = function() {
        while (this.maxscroll>1) {
        this.text = this.text.substr(0, -1);
        }
}

where "textField" is the name of your input field. You need to trap both scroller and
onChanged events to make it bullet proof.

Cheers

Joe



Joe Cutting
Computer exhibits and installations
www.joecutting.com
The Fishergate Centre, 4 Fishergate, York, YO10 4FB
01904 624681

As of 30th October 2006 I have a new office so
please note my new address and phone number _______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to