Web Wiz - Solar Powered Eco Web Hosting

  New Posts New Posts RSS Feed - Show first few lines of text in form
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Show first few lines of text in form

 Post Reply Post Reply
Author
Andy Rowland View Drop Down
Groupie
Groupie
Avatar

Joined: 13 July 2004
Location: London
Status: Offline
Points: 86
Post Options Post Options   Thanks (0) Thanks(0)   Quote Andy Rowland Quote  Post ReplyReply Direct Link To This Post Topic: Show first few lines of text in form
    Posted: 29 November 2010 at 12:11pm
How do I show the first few lines of text in a form and have a read more link at the side.
ASP
Back to Top
Scotty32 View Drop Down
Moderator Group
Moderator Group


Joined: 30 November 2002
Location: Manchester, UK
Status: Offline
Points: 1682
Post Options Post Options   Thanks (0) Thanks(0)   Quote Scotty32 Quote  Post ReplyReply Direct Link To This Post Posted: 13 December 2010 at 8:13pm

Do you mean trim a string down?

You could do something like this:

<%

Dim strMessage

strMessage = "Hello World. Hello World. Hello World. Hello World. Hello World."
if len(strMessage) > 30 then strMessage = mid(strMessage, 1, 30) & "..."
Response.Write( strMessage )

%>


This quick code sample will shorten the string if it is larger than 30 characters to 30 characters and add "..." to the end.

Change the both of the number 30s above to your desired length



Edited by Scotty32 - 13 December 2010 at 8:25pm
S2H.co.uk - WebWiz Mods and Skins

For support on my mods + skins, please use my forum.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.07
Copyright ©2001-2024 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Policy

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2024 Web Wiz Ltd. All rights reserved.