Skip to main content
October 30, 2008
Question

How to handle substring in page

  • October 30, 2008
  • 1 reply
  • 325 views
I'm displaying the value of a column from a table in two pages - a preview page and a detail page. This column in the db contains text from an article that includes html tags for formatting.

On the preview page, I'm displaying the first 500 characters in this field. (I want to show the first few sentences of the article) On the detail page, I display all the characters in that field - the whole article. I ran into a problem today where the 500th character is part of a closing html tag. By displaying less than the whole tag, the tag is left open on my page and causes portions of what follows on the page to break.

Any suggestions for better ways to handle this? CS3/MSAccess2000/ASP

Thanks everyone.
This topic has been closed for replies.

1 reply

Inspiring
October 30, 2008
NewDevGuy wrote:
> I'm displaying the value of a column from a table in two pages - a preview page
> and a detail page. This column in the db contains text from an article that
> includes html tags for formatting.
>
> On the preview page, I'm displaying the first 500 characters in this field.
> (I want to show the first few sentences of the article) On the detail page, I
> display all the characters in that field - the whole article. I ran into a
> problem today where the 500th character is part of a closing html tag. By
> displaying less than the whole tag, the tag is left open on my page and causes
> portions of what follows on the page to break.
>
> Any suggestions for better ways to handle this? CS3/MSAccess2000/ASP
>
> Thanks everyone.

Most of the CMS/Blog systems I have come across have 2 fields, one for
the summary, and one for the main content. The Summary is limited to 500
characters. You then just display the summary on the preview page, and
then both the summary and the main content on the detail page.

Dooza

--
Posting Guidelines
http://www.adobe.com/support/forums/guidelines.html
How To Ask Smart Questions
http://www.catb.org/esr/faqs/smart-questions.html