473,230 Members | 1,490 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,230 software developers and data experts.

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 3126

"Matt" <md*******@radford.edu> wrote in message
news:11*********************@c13g2000cwb.googlegro ups.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
_______________________________________
| blahblahblahblahb | ^ |
|lahblahblahblahblahb | 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
_______________________________________
| blahblahblahblahb | ^ |
|lahblahblahblahblahb | 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><?php print $content; ?></textarea>

and not
**<textarea>
***<?php
****print*$content;
***?>
**</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><?php print $content; ?></textarea>

and not
**<textarea>
***<?php
****print*$content;
***?>
**</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 htmlspecialchars($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
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...
5
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
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...
3
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...
10
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...
2
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...
6
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...
3
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 (); ...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

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.