Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
How to show a complete textarea ??
Old 10-08-2009, 12:28 PM How to show a complete textarea ??
Junior Talker

Posts: 2
Name: pete leblanc
Trades: 0
I enter Client Case Notes notes in a textarea field on a PHP form. The field is 5 rows deep and 70 chars wide , using the scroll bar to see beyond 5 lines.

After entering notes, I want to echo or print the entire textarea without the scrollbar so that i do File Print to print out the complete notes. The problem is that using Print or Printf of the textarea variable prints a stream all on one line, with no newlines - this is too wide to print out for longer notes.

how can i do this?
PeteLB is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 10-08-2009, 12:38 PM Re: How to show a complete textarea ??
mgraphic's Avatar
Truth Seeker

Latest Blog Post:
JAMISONTUNES
Posts: 2,898
Name: Keith Marshall
Location: Connecticut
Trades: 0
You can use nl2br() function to replace newlines to <br /> html tags, and you can force newlines using wordwrap(). For example, if I wanted to display form post data in a container that allowed overflow, I would use the following:

echo nl2br(htmlentities(wordwrap($_POST['textarea'], 70)));
__________________

<mgraphic /> - I don't have a solution but I admire the problem.
mgraphic is offline
Reply With Quote
View Public Profile
 
Old 10-08-2009, 12:42 PM Re: How to show a complete textarea ??
Experienced Talker

Posts: 45
Trades: 0
new to me .. thank you
__________________

Please login or register to view this content. Registration is FREE
dan101 is offline
Reply With Quote
View Public Profile
 
Old 10-08-2009, 05:25 PM Re: thanks
Junior Talker

Posts: 2
Name: pete leblanc
Trades: 0
thanks mgraphic,

that works just fine - I can even specify the font type and size in the statement.

just curious - is there any way to print directly from PHP to a specific printer? my process is two steps - display with echo or print, then File Print from the Explorer toolbar.

thanks again for the tip.
PeteLB is offline
Reply With Quote
View Public Profile
 
Old 10-08-2009, 06:31 PM Re: thanks
mgraphic's Avatar
Truth Seeker

Latest Blog Post:
JAMISONTUNES
Posts: 2,898
Name: Keith Marshall
Location: Connecticut
Trades: 0
Quote:
Originally Posted by PeteLB View Post
just curious - is there any way to print directly from PHP to a specific printer? my process is two steps - display with echo or print, then File Print from the Explorer toolbar.
No, that can only be done using Javascript (and I don't think it's possible to specify the printer for the user, only just open the print dialog window).
__________________

<mgraphic /> - I don't have a solution but I admire the problem.
mgraphic is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to How to show a complete textarea ??
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.26101 seconds with 12 queries