0

enter image description hereI tried my best to get this resolved but end up with negative results.

I have text box, and the length is 1300 chars. But I want that to display in multilines. I tried a lot of things and I got horizontal scrollbar but didn't get the vertical scroll bar. The string is displaying in a single line which I don't want. I want that to break at end of the textbox and continue displaying on the next line.

var  tmpArray = document.forms['form1'].elements["fa_col_value"];
var mainCdo = g_CdoMgr.getCdoByName("TempFaObjectCdo");
var flexCdoCol = mainCdo.getCdoColByName("fa");

if(flexCdoCol.get(i).getField("label") == "Additional Notes" )
{
    tmpArray[i-j].style.width="350";
    tmpArray[i-j].style.height="100";
}

In the above code, I tried to change the height and width but displaying is what bothers me. I want this to be displayed over multiple lines. This is generic for all the elements in that page.

//tmpArray[i-j].style.overflow="auto";

When using this I'm getting a horizontal scroll bar also [which is not useful for me]. but when I tried vertical options that is not working at all.

I tried break-all/break-word, but no use.

Image1

The image shows the data. Red represents the part which I need to change, and green is the string that need to be displayed in multiline.

Image2

Here the string is displaying in single line. That needs to be rendered vertically.

Koti Panga
  • 3,660
  • 2
  • 18
  • 21
user1835935
  • 45
  • 1
  • 5

3 Answers3

0

I think this is related to your problem.

Please see

Paste multiline text in input type text (not textarea)

Community
  • 1
  • 1
Rehman
  • 51
  • 2
  • i tried doing that but no use. in that text box user will enter the text.that text i have copied for testing purpose. In the link you have given ,i dont see anything. im using IE6, that is wat my worry too. – user1835935 Jul 23 '13 at 09:05
0

You are using input field, but you should be using textarea http://www.w3schools.com/tags/tag_textarea.asp because textarea is used for multi-line text display

DejanG
  • 525
  • 1
  • 10
  • 17
  • I have added a new image , i cant change that to textarea. it will impact all the other rows as well.I want the text in the that boz split into multiple lines. converting textbox to textarea and that to for this particular field only like i did for height and width. – user1835935 Jul 23 '13 at 09:03
  • You simply can not _display_ a value over more than one line in an input type=text. A textarea seems to be what you really want – _why_ you can’t just use one, I can not see. – CBroe Jul 23 '13 at 09:08
  • You also need something like this http://www.w3schools.com/tags/att_textarea_wrap.asp – DejanG Jul 23 '13 at 09:10
  • cant we change style of that particular roe, like i did with height & width.i tried assigning innerHTML to – user1835935 Jul 23 '13 at 09:14
  • You are probably doing something wrong because textarea is almost like usual input field there is not many difference between them ` document.getElementById('myTextarea').value = '';` – DejanG Jul 23 '13 at 09:18
  • @DejanG, HTML file is an outofbox code. I cant change the definition.i can nly manipulate from some where that too only for my particular filed.This should not effect other text boxes at any cost. – user1835935 Jul 23 '13 at 09:35
0

Alternatively you can use text area with small jQuery Code.

      $("#tArea").on("keydown", function () {
          var $that = $(this);
          if ($that.val().length >= 50) {

              $that.val($that.val().substring(0, 49));


          }


      });
Rehman
  • 51
  • 2