ksmatthews Posted August 10, 2010 Share Posted August 10, 2010 Hi All, I am having problems writing to the textarea HTML object. Basically I am losing my new line char and the text looks awful and unintelligible. How can I get my new lines appended at the end so that each line is separate. Here is some code ... Creating EACH data line: $arrCsvRow = array( $arrTags['DATE_UPLOADED'], $arrTags['SCAN_NUMBER'], $arrTags['OPERATOR'], $arrTags['REFERENCE'], $arrTags['CURRENCY'], $arrTags['GOODS'], $arrTags['VAT'], $arrTags['TOTAL'], $arrTags['PAID_TITLE'] ); $arrCsv[] = implode(',', $arrCsvRow); etc .... Dumping it all at the end ... $arrTags['CSV_OUTPUT'] = implode("\n", $arrCsv); Note: $arrTags['CSV_OUTPUT'] is added to a text area control WITHIN a template Any advice appreciated, regards, ksmatthews Quote Link to comment https://forums.phpfreaks.com/topic/210308-writing-data-to-textarea-control/ Share on other sites More sharing options...
RussellReal Posted August 10, 2010 Share Posted August 10, 2010 Show us what you get and what you expect to get.. seperating by \n SHOULD be enough to get you lines Quote Link to comment https://forums.phpfreaks.com/topic/210308-writing-data-to-textarea-control/#findComment-1097436 Share on other sites More sharing options...
ksmatthews Posted August 10, 2010 Author Share Posted August 10, 2010 Should get this ... 08-07-2010,277,CLICKATELL,CLICKATELL_June_Oct_09,GBP,33179.70,0.00,33179.70,Paid on 10/02/2010 08-07-2010,182,IPX,IPX_Jul09_23852,EUR,1654.55,0.00,1654.55,Paid on 02/12/2009 10-06-2010,406,NETM,07091486,EUR,721.17,0.00,721.17,Paid on 24/03/2010 08-04-2010,342,COMEXME,Comexme_July09 - Dec09,USD,2131.11,0.00,2131.11,Paid on 08/04/2010 But I get this ... 08-07-2010,277,CLICKATELL,CLICKATELL_June_Oct_09,GBP,33179.70,0.00,33179.70,Paid on 10/02/201008-07-2010,182,IPX,IPX_Jul09_23852,EUR,1654.55,0.00,1654.55,Paid on 02/12/200910-06-2010,406,NETM,07091486,EUR,721.17,0.00,721.17,Paid on 24/03/201008-04-2010,342,COMEXME,Comexme_July09 - Dec09,USD,2131.11,0.00,2131.11,Paid on 08/04/2010 WHY ? Is this a CSS issue ? Steven M Quote Link to comment https://forums.phpfreaks.com/topic/210308-writing-data-to-textarea-control/#findComment-1097451 Share on other sites More sharing options...
Wolphie Posted August 10, 2010 Share Posted August 10, 2010 Can we see the code that you have for that specific bit please? Quote Link to comment https://forums.phpfreaks.com/topic/210308-writing-data-to-textarea-control/#findComment-1097468 Share on other sites More sharing options...
ksmatthews Posted August 10, 2010 Author Share Posted August 10, 2010 $arrTags['CSV_OUTPUT'] = implode("\n", $arrCsv); Note: $arrTags['CSV_OUTPUT'] is added to a text area control WITHIN a template I HAVE EVEN TRIED EXPLICITLY ADDING A '\n' BUT TO NO AVAIL .... Quote Link to comment https://forums.phpfreaks.com/topic/210308-writing-data-to-textarea-control/#findComment-1097483 Share on other sites More sharing options...
Adam Posted August 10, 2010 Share Posted August 10, 2010 Are you using a template engine? Can you show the code where you actually output the data? Quote Link to comment https://forums.phpfreaks.com/topic/210308-writing-data-to-textarea-control/#findComment-1097484 Share on other sites More sharing options...
ksmatthews Posted August 10, 2010 Author Share Posted August 10, 2010 <div class="dataContent" id="content_csvOutput_statement"> <textarea class="csvOutput">{CSV_OUTPUT}</textarea> </div> Steven M Quote Link to comment https://forums.phpfreaks.com/topic/210308-writing-data-to-textarea-control/#findComment-1097492 Share on other sites More sharing options...
Adam Posted August 10, 2010 Share Posted August 10, 2010 Well then I'm guessing it has something to do with the template engine. Which are you using? Quote Link to comment https://forums.phpfreaks.com/topic/210308-writing-data-to-textarea-control/#findComment-1097495 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.