Leading space in text field types

4 posts by 2 authors in: Forums > CMS Builder
Last Post: September 23, 2010   (RSS)

Can you explain why text fields types are stored in the database with a leading space? It makes for sloppy output if you're pulling those fields out and placing them in a list if the text wraps to more than one line. The first line indents a bit.

Thanks,
Jim
WebCamp One, LLC



Websites That Work

Re: [Mr Jim] Leading space in text field types

By Chris - September 22, 2010

Hi Jim,

I don't text fields are stored with a leading space. At least, not intentionally.

You can get rid of leading whitespace using the ltrim() function:

<?php echo ltrim($record['field']) ?>

I hope this helps! Please let me know if you have any questions.
All the best,
Chris

Re: [Mr Jim] Leading space in text field types

By Chris - September 23, 2010

Hi Jim,

What browsers, specifically, have this problem. I'd like to do some research and see if we can come up with a solution for this.
All the best,
Chris