how i will set plain text to html field ?

Debarpita
Tera Contributor

Kindly guide i have plain text message field trying to set in html field but facing alignment problem means table "abc" have message with:-

Hi customer,

I am sweet.

 

i have doll.

 

i have a pet dogs.

 

 

regards Deb.

 

but in table "xyz" in html field it is coming :- 

Hi customer,I am sweet.i have doll.i have a pet dogs.regards Deb.

 in client script using this code after getting the answer from script include :

 

var answer = response.responseXML.documentElement.getAttribute("answer");
            var answer2 = answer.replace (/\n/g,"abcd0657412");
            alert("answer2-"+answer2);
            var answer3 = answer2.replace (/abcd0657412/g,'\n');
            alert("answer3-"+answer3)
                    g_form.setValue("u_html_message", answer3);

 

 

Note: In anwser i am getting right format but in html is not .

 

Kindly help me to set the alignment in html fields same as plain text. @asifnoor  or @ankurbiswas 

2 REPLIES 2

Mahathi
Mega Sage
Mega Sage

Hi @Debarpita ,

You can try using &nbsp or <p> tags to see the lines in the format you have given.

Kindly mark helpful and accept it as solution if it resolved your issue.

Thanks,
Mahathi

Hi , thanks for the reply . Kindly help with full code