Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

TextArea Issues

Guest
Jul 29, 2011 Jul 29, 2011

Copy link to clipboard

Copied

HI

I am going to ask this anyway, but it seems that the only way to really use these is to add something like tinymsc.

2 things i would like to achieve.

i would like to remove the scroll bar and keep the text area at the size i defined 65 cols x 4 rows, no scroll bar. overflow:hidden does not seem to work here.

the second issue is with saving/re-dsiplaying the data.

if you hit enter in the text box, it appears to add to extra line breaks into the data, so when it's displayed again it shows the text with 2 extra lines inserted.

i and this to appear as typed.

I have looked at nl2br and str_replace, but i am not sure if i am using them as i should.

example here -

typing text and then hitting enter<br />
<br />
<br />
seems to add 2 more line breaks<br />
<br />
<br />
which i do not want.<br />
<br />

it should be

typing text and then hitting enter<br />
seems to add 2 more line breaks<br />
which i do not want.<br />

any suggestions before i have to start adding another 3rd party tool??

Thanks

TOPICS
Server side applications

Views

278
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Aug 09, 2011 Aug 09, 2011

Copy link to clipboard

Copied

well i found a post elsewhere that gave me the solution

I can't find the full post now, lost the link...

TinyMCE did not work out very well.

so here is what i came up with, the origional post i found had a larger array, but i cut it down to what suited

function convertTextarea($tval) {
$newtext = str_replace(array("\n\r","\n"), '', $tval);

return $newtext;
}

anyway maybe this will help others.

do i get 10 points ... !!

KM

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Aug 09, 2011 Aug 09, 2011

Copy link to clipboard

Copied

LATEST

Answered myself.

code in reply

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines