Textfield <div><br>-Problem in text/html-var

  • Hi,

    I use an editable textfield with "editenterkey,newline" where users can enter a short message which will be send via mail (body). So far, so good.
    BUT the text-variable does´nt only contain the entered text but also the html-tags *blink*

    If I enter the following text into the textfield:
    Hello,
    my name is

    Nupsi!

    then the text-variable of the textfield contains this:
    <div>Hello,</div><div>my name is</div><div><br></div><div>Nupsi!<br></div>

    Unfortunately I have no idea how to transfer this into the mail-body without the html-tags. I did try txtreplace to replace the tags with %%0A but there is no way to replace "<" and ">". I also did try to use "[", "[lt]" and "]" "[gt]" instead. I even tried the ascii-codes "& # 60 ;" and "& # 62 ;" but txtreplace just won´t recognize any of those.

    So how do I transfer the entered text in my example to the mail-body?

    Thanks in advance *thumbsup*
    Nupsi

  • Thanks for your feedback guys *thumbsup*

    indexofrefraction
    I´m using Win10 and the error appears in every browser (Edge,FF,Chrome). I´m using the latest build 1.21 build 2023-03-30.

    s-maier
    I would like to avoid using php or js for this. Right now it´s only via krpano and mailto with txtadd for the body.
    And to be honest, I have no idea, how to replace < d i v >< / d i v > using text.replace, because JS still recognizes it as code *wacko*

  • I really would't go for mailto:.

    This is kinda year 2000 stuff. When have you last seen mailto-links somewhere? Many people don't even have mail clients on theire device as so many web based services are in use.

    In JS you could try:

    Code
    text = text.replace(/(<div>|<\/div>)/g, "");

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!