PDA

View Full Version : textArea Html Default Tags


LeahSmart
03-03-2006, 12:14 PM
Hello.

I have a textArea with HTML set to true. If the field is blank and the user enters some text it seems to add some default HTML tags.

To reproduce this create a new movie and add the textArea and button component to your library. Then add the below code. Run the movie and enter some text into the textArea and press Display.

this.attachMovie ("textArea", "tx_Test", 1)
this.attachMovie ("button", "bt_Show", 2)

tx_Test.setSize (400,200)
tx_Test.html = true

bt_Show.label = "Display"
bt_Show._y = 210



bt_Show.onRelease = function (){
trace (tx_Test.text)
}

Is there any way of stopping it doing this?

I also need a way of counting the number of characters within the field, I want the cound to exclude all the HTML tags. So <B>Hello</B> would be 5 characters and not 14.

I am planning on add my own buttons to the movie to allow the user to set text as bold, this is the reason I have set it to HTML.

Thanks

Leah