473,804 Members | 3,018 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

TextArea formatting issue

I have a textarea that is populated from a blob within a database.
Everytime the data is pulled, however, there is always a lot of leading
space characters before the actual text. It is not in the database
this way, so how might I specify more formatting parameters within the
textarea?

Matt Williams

Jul 17 '05 #1
6 3171

"Matt" <md*******@radf ord.edu> wrote in message
news:11******** *************@c 13g2000cwb.goog legroups.com...
I have a textarea that is populated from a blob within a database.
Everytime the data is pulled, however, there is always a lot of leading
space characters before the actual text. It is not in the database
this way, so how might I specify more formatting parameters within the
textarea?

Matt Williams


What I found was that I had a statement like....

echo ' blab blaob
'.$mytext.'
and so on'

and that spaces were added because of the line and perhaps also the
'invisible' extra space in the document on those lines after the code.

I changed it to

echo 'bla bla '.$mytext.' bla bla'

and this helped - but I am only a novice novice, so dont take it too
serious.
Jul 17 '05 #2
This would be my first suspicsion as well, but I entered my sample data
in the database by hand for testing purposes....... it has no extra
space appended to either sid of the text. I will try and draw what is
happening to my data
_______________ _______________ _________
| blahblahblahbla hb | ^ |
|lahblahblahbla hblahb | v |
----------------------------------------

Jul 17 '05 #3
Matt wrote:
This would be my first suspicsion as well, but I entered my sample data
in the database by hand for testing purposes....... it has no extra
space appended to either sid of the text. I will try and draw what is
happening to my data
_______________ _______________ _________
| blahblahblahbla hb | ^ |
|lahblahblahbla hblahb | v |
----------------------------------------


So where is the PHP code that you suspect is causing a problem?

NM

--
convert uppercase WORDS to single keystrokes to reply
Jul 17 '05 #4
Matt wrote:
I have a textarea that is populated from a blob within a database.
Everytime the data is pulled, however, there is always a lot of leading
space characters before the actual text. It is not in the database
this way, so how might I specify more formatting parameters within the
textarea?

Matt Williams

Make shure you put your text in the textarea as follows:
<textarea><?p hp print $content; ?></textarea>

and not
**<textarea>
***<?php
****print*$cont ent;
***?>
**</textarea>

The second will produce spaces in front and at the end of $content;
--
Rutger Claes rg*@rgc.tld
Replace tld with top level domain of belgium to contact me pgp:0x3B7D6BD6
Do not reply to the from address. It's read by /dev/null and sa-learn only

Jul 17 '05 #5
Make shure you put your text in the textarea as follows:
<textarea><?p hp print $content; ?></textarea>

and not
**<textarea>
***<?php
****print*$cont ent;
***?>
**</textarea>

The second will produce spaces in front and at the end of $content;


Not entirely, whitespace after ?> is removed.

and it should be:
echo htmlspecialchar s($content);

to avoid problems with <> chars in text.

--
* html {redirect-to: url(http://browsehappy.pl) ;}
Jul 17 '05 #6
Excellent!!! This fixed the last my problems within this app. I put
the statements inline and everything looks perfectly formatted.....
Thanks

Matt Williams

Jul 17 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
14799
by: bonehead | last post by:
I am using a php html form with data which is loaded from a mysql database. Three of the fields are textareas. The data loads into these fields fine, except that the loaded text starts at what appears to be 2 or 3 tab characters to the left. See illustration: +---------<this is a textarea object>---------+ | This is about the way that| |the text loads from the database field. | | ...
5
4911
by: Piotr Wolski | last post by:
how can i format textarea? f.e.: <textarea><b>i wqant this text to be bold</b></textarea>
6
15458
by: TomT | last post by:
Hi, I've created a form that has a 3 fields. 2 textboxes (username & password) 1 TextArea (notes) I have linked this to an access DB. This is working well, the user enters thier Username & password, fills
3
2516
by: Kent | last post by:
Hi all, Thank you in advance. Here is the issue: I need to create a page that allows users to copy the contents of a MS Word document and paste them into a textarea. All fine and dandy...but the tabs. I don't need to keep the formatting, just the tabs. Is there any way to detect the tabs and change them to four spaces or something similar? If you have any other ideas please let me know. Thanks again for your help, Kent
10
3065
by: Perry van Kuppeveld | last post by:
Hi, I have a problem with formatting a table including text fields wich can contain up to 255 chars. I need a table with 3 columns: - First column 50 % over the with a rowspan of the total number of rows. - Second column 25 %, no rowspan - Third column 25 %, no rowspan
2
2469
by: Michael | last post by:
Question 1 ---------------- I am writing an advanced BBCode system for my forums and I would like to be able to find where the cursor was positioned last in the text so I could insert the BBCode there. Question 2 ---------------- Again I am writing an advanced BBCode system for my forums and I would like to make is so that when someone puts in a tag it goes bold, so
6
31457
by: Tony | last post by:
The w3schools HTML tag reference for <textarea> http://www.w3schools.com/tags/tag_textarea.asp says that the attributes 'cols' and 'rows' are REQUIRED attributes for the textarea tag. Looking at the HTML 4.01 specification I see this, too. What I'm wondering is - 'cols' & 'rows' determines the height & width of a textarea. So shouldn't that be something that is handled by CSS instead? What would be the practical consequence of leaving...
3
2120
by: LoliPopas | last post by:
I'm stupid in Javascripting, but i making php forum with BBcode. and i need help with this: <head> <script> function formatSelected(from_obj, formatting, format2) { from_obj.focus (); var w = self.document.selection.createRange (); w.text = ""+w.text+""; }
0
10562
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10319
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10303
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10070
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7608
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6845
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5639
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3803
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2978
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.