How to put a newline in the text being inserted into an

How to put a newline in the text being inserted into an

obrienjobrienj Posts: 93Questions: 38Answers: 0

Allan,

I have plowed through every post containing the word "newline: and can't sort out this question.

I have a field defined in the editor (or Datatables Editor creates it from my input)

<input id="whenHolder" type=text readonly="readonly">

I use the following to put text into the field:

editor.field('whenHolder').input().val( sdate + " to " + edate + "\n" + rpts);    <====== note the "\n"
                                                                    

And trust me all of the fields (sdate, edate, and rpts) have data in them.

What I see is the whole text in the box and where the "\n" was, is blank and the text is one line.

I use an "<input .... type=text readonly="readonly">" because I want all fields to look the same and when this field is clicked is brings up a modal in which the above data is entered.

The newline is simply for readability and the area is large enough to accommodate the text with and without the "\n".

How do I do this?

Regards,
Jim

Answers

This discussion has been closed.