Web Design and Development Forums

[SOLVED] breaklines in textarea

This is a discussion on "[SOLVED] breaklines in textarea" within the PHP Forum section. This forum, and the thread "[SOLVED] breaklines in textarea are both part of the Program Your Website category.


Go Back   Webforumz.com > Program Your Website > PHP Forum

Welcome to Webforumz.com.
Register Now Register now!

Reply
 
LinkBack Thread Tools Rate Thread
Old Apr 10th, 2008, 11:46   #1 (permalink)
New Member
 
Join Date: Apr 2008
Location: preston
Posts: 2
[SOLVED] breaklines in textarea

i need to add break lines into the discription textarea which is highlighed in bold

this is the backend form

Code: Select all
<form enctype="multipart/form-data" action="" method="post" >
<input type="hidden" name="MAX_FILE_SIZE" value="8000000">
<table  border="0" class="block">  
<tr><td colspan="2" style="text-align: center ">
<?php if($html["id"]["prev"]!=""){
 ?><a href="?action=show_custom&amp;id=<?php echo $html["id"]["prev"]?>&amp;cat=<?php echo $html['cat']['id']?>">&laquo;prev</a>
 <?php }else{
  ?>&laquo;prev<?php }?>
|
<a href="?cat=<?php echo $html['cat']['id']?>&amp;offset=<?php echo $html['offset']?>">thumbs</a>
|
<?php if($html["id"]["next"]!=""){
 ?><a href="?action=show_custom&amp;id=<?php echo $html["id"]["next"]?>&amp;cat=<?php echo $html['cat']['id']?>">next&raquo;</a>
 <?php }else{
  ?>next&raquo;<?php }?>
</td></tr>
<tr><th colspan="2"><?php echo $html["item"]["title"]?></th></tr>
<tr>
<td>Thumbnail:</td>
<td>
<IMG src="../rwx_gallery/thumbs/<?php echo $html["item"]["filename_thumb"]?>" alt="thumb">
<br>
<input type="radio" name="thumb_static" id="thumb_static" checked value="Y" onClick="showhide_thumb()">static (load from another file)
<input type="file" name="filename_thumb" id="filename_thumb"  >
<br>
<input type="radio" name="thumb_static" value="N" id="thumb_auto" onClick="showhide_thumb()">auto
(<?php 
if( !function_exists('imagepng') && !function_exists('imagejpg') && !function_exists('imagegif'))
 echo "disabled: no GD library image formats available";
else 
 {
  echo "only for ";
  if(function_exists('imagejpeg'))echo ".jpg/.jpeg";
  if(function_exists('imagepng'))echo " .png";
  if(function_exists('imagegif'))echo " .gif";
   echo " files";
 }
?>)
<script type="text/javascript">
function showhide_thumb()
{
 if(document.getElementById("thumb_static").checked)
  document.getElementById("filename_thumb").style.visibility = "visible";
 else
  document.getElementById("filename_thumb").style.visibility = "hidden";
}
showhide_thumb();
</script>
</td>
</tr>
<tr>
<td >File:</td>
<td >
<?php 
$ext = strtolower(strrchr($html["item"]["filename_normal"],'.'));
if($ext == ".swf"){?>
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
 codebase="http://download.macromedia.com/pub/s...ersion=5,0,0,0"
<?php echo ($html["item"]["size_w"])?"width=\"".$html["item"]["size_w"]."\"":""?> <?php echo ($html["item"]["size_h"])?"height=\"".$html["item"]["size_h"]."\"":""?> >
 <PARAM NAME=movie VALUE="../rwx_gallery/<?php echo ($html["item"]["filename_normal"])?>"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF> 
 <EMBED src="../rwx_gallery/<?php echo ($html["item"]["filename_normal"])?>" quality=high bgcolor="#FFFFFF" <?php echo ($html["item"]["size_w"])?"width=\"".$html["item"]["size_w"]."\"":""?> <?php echo ($html["item"]["size_h"])?"height=\"".$html["item"]["size_h"]."\"":""?> TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED>
</OBJECT>
<?php }else if($ext == ".mov" || $ext == ".pano"){?>
<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" <?php echo ($html["item"]["size_w"])?"width=\"".$html["item"]["size_w"]."\"":""?> <?php echo ($html["item"]["size_h"])?"height=\"".$html["item"]["size_h"]."\"":""?> codebase="http://www.apple.com/qtactivex/qtplugin.cab" id="qtvrObject">
<param name="autoplay" value="true">
<param name="controller" value="true">
<param name="pluginspage" value="http://www.apple.com/quicktime/download/indext.html">
<param name="target" value="myself">
<param name="type" value="video/quicktime">
<param name="src" value="../rwx_gallery/<?php echo $html["item"]["filename_normal"]?>">
<embed src="../rwx_gallery/<?php echo $html["item"]["filename_normal"]?>" <?php echo ($html["item"]["size_w"])?"width=\"".$html["item"]["size_w"]."\"":""?> <?php echo ($html["item"]["size_h"])?"height=\"".$html["item"]["size_h"]."\"":""?> autoplay="true" controller="true" border="0" pluginspage="http://www.apple.com/quicktime/download/indext.html" target="myself" type="video/quicktime"  name="qtvrObject" EnableJavaSript="true" ></embed>
</object>
<?php } else if($ext == ".jpg" || $ext == ".jpeg" || $ext == ".png" || $ext == ".gif"){?>
<IMG src="../rwx_gallery/<?php echo $html["item"]["filename_normal"]?>" <?php echo ($html["item"]["size_w"])?"width=\"".$html["item"]["size_w"]."\"":""?> <?php echo ($html["item"]["size_h"])?"height=\"".$html["item"]["size_h"]."\"":""?> alt="file">
<?php  } else { ?>
<a href="../rwx_gallery/<?php echo $html["item"]["filename_normal"]?>">../rwx_gallery/<?php echo $html["item"]["filename_normal"]?></a>
<?php  } ?>
<br>
<INPUT name="filename_normal" type="file" onClick="document.getElementById('thumb_auto').checked=true;showhide_thumb();">
</td></tr>
<tr>
 <td >Image width:</td>
 <td ><input type="text" size="3" name="size_w" value="<?php echo $html["item"]["size_w"]?>"> (0 - default width) </td>
</tr>
<tr>
 <td >Image height:</td>
 <td ><input type="text" size="3" name="size_h" value="<?php echo $html["item"]["size_h"]?>"> (0 - default height) </td>
</tr>
<tr>
<td >Description:</td>
 <td ><textarea name="description" cols="75" rows="25"><?php echo $html["item"]["description"]?></textarea></td>
</tr>
<tr><th colspan="2" ><INPUT type="submit" value="Submit"></th></tr>
</TABLE>
<INPUT type="hidden" name="action" value="gallery_update_custom">
<INPUT type="hidden" name="id" value="<?php echo $html["id"]["curr"]?>">
<INPUT type="hidden" name="cat" value="<?php echo $html["cat"]["id"]?>">
<INPUT type="hidden" name="page" value="foto">
</form>

this is the code for where its placed

 <?php echo $html['item']["description"]?>
can anyone help

Last edited by saltedm8; Apr 10th, 2008 at 19:26. Reason: added [code] tags
andyg is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Apr 10th, 2008, 12:27   #2 (permalink)
Chief Moderator
 
aso186's Avatar
 
Join Date: Oct 2007
Location: UK
Posts: 701
Blog Entries: 2
Send a message via Skype™ to aso186
Re: breaklines in textarea

Not sure if I understood, but have you tried wrapping $html['item']['description'] in nl2br?

Something like
PHP: Select all

<?php echo nl2br($html['item']["description"]);?>

__________________

aso186 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Apr 10th, 2008, 13:31   #3 (permalink)
New Member
 
Join Date: Apr 2008
Location: preston
Posts: 2
Re: breaklines in textarea

thanks that great
andyg is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Textarea errors pritmadlani HTML Forum 2 Apr 3rd, 2008 20:58
Formatting Passed Value Within ASP Page In Textarea? Monie ASP Forum 15 Nov 27th, 2007 23:57
transorm xml in textarea scribble XML, RSS & Atom 0 Nov 29th, 2006 23:18
Controlling Textarea Size With CSS xKillswitchx CSS Forum 2 Mar 4th, 2006 06:11
[SOLVED] How To: Change characters in a textarea? Using Javascript Anonymous User JavaScript Forum 0 Feb 16th, 2005 12:34



Latest Updates

All Points SEO Security Advisory - CHECK YOUR SITE NOW!

Creative Coding :: February 2008

Webforumz is sponsored by: WESH UK Web Hosting
All times are GMT. The time now is 11:03.

Sleep Study Scoring :: Free Bet :: Website Templates :: Online Betting :: Bookmakers :: Funny Quotes :: Internet Recruitment Software :: Microsoft CRM Experts :: Online Casino :: Decorated Christmas Trees :: Midwife Forums :: Football Betting :: Ecommerce Software :: Web Hosting :: Football Stats :: Dry Cleaning Collection :: xtreme wales - extreme clothing :: Apuestas :: Sharepoint Consultants :: Website Optimisation :: Office Clearance London :: Sharepoint Experts :: Sports Betting :: Casino :: Website Templates :: Web Design Development India :: Online Gambling

Powered by: vBulletin Version 3.7, Copyright ©2000 - 2008, Jelsoft Enterprises Limited.
© 2003-2008 Webforumz.com : All Rights Reserved
Search Engine Friendly URLs by vBSEO 3.2.0 RC6


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59