Jump to content

Archived

This topic is now archived and is closed to further replies.

ksmatthews

Writing data to textarea control

Recommended Posts

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

 

 

Share this post


Link to post
Share on other sites

Show us what you get and what you expect to get.. seperating by \n SHOULD be enough to get you lines :)

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Can we see the code that you have for that specific bit please?

Share this post


Link to post
Share on other sites

$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 ....

Share this post


Link to post
Share on other sites

Are you using a template engine? Can you show the code where you actually output the data?

Share this post


Link to post
Share on other sites

<div class="dataContent" id="content_csvOutput_statement">

<textarea class="csvOutput">{CSV_OUTPUT}</textarea>

</div>

 

 

Steven M

Share this post


Link to post
Share on other sites

Well then I'm guessing it has something to do with the template engine. Which are you using?

Share this post


Link to post
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.