Avatar billede f5 Nybegynder
23. juni 2004 - 11:32 Der er 2 kommentarer

Kopiere HTML tekst og HTML formatering dynamisk

Hej,

Jeg har lige formuleret et spørgsmål på et engelsk forum, men da det oftes er hurtigere og kvalificeret her inde ;-) vil jeg også prøve her. Jeg har pasted mit engelske spørgsmål ind nedfor....


I have a problem with copying some html text from a textfield WITH its html
formating. Here is my problem:

I pull in some htmlformatted text from an XML file. I put the text up in a
dummy textfield with its html formatting. I then need portions of this text
to display on the screen. I do this because I need to display my final text
in colums. I therefore set it up in a fomrattede dummyfield and find out how
much text i can fit into one of my colums. I dynamically selct the text from
the dummy field and place it into my final colum-textfield.

I get the selection out of the dummy field like this:

this.textContainer_1.dummy.text.substring(0, myEnd1)

MyEnd1 is a variable that tells me how far down in the tekst i should
select.

This all works fine, except this brings over the actaully text WITHOUT the
html formatting behind it.

Does anyone have a suggestion for how, knowing what part of the formatted
text i need, I can bring it over WITH the HTML formatting. The issue being
that if I do anything like:

this.textContainer_1.dummy.hrmlText.substring(0, myEnd1)

my count doesnt work because i will count the html tags as part of the
string!!!

I can give the code for how I get the myEnd1 var if that could help anyone.

Thanks
Michael
Avatar billede pyroman Nybegynder
23. juni 2004 - 14:18 #1
Er dummy sat til til at rendere html? altså er "html" sat til true?
Avatar billede pyroman Nybegynder
23. juni 2004 - 14:25 #2
Det smarteste ville være at du lagde teksten i en variabel, sådan at den ikke e berørt af nolge tekstfelters formatering... Du kan evt. hente teksten dynamisk fra xml-filen ind i flash...
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
IT-kurser om Microsoft 365, sikkerhed, personlig vækst, udvikling, digital markedsføring, grafisk design, SAP og forretningsanalyse.

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester