[thelist] ASP question: the string is too long for the pulldown menu

BT Bigpant bigpant at btinternet.com
Tue Feb 5 16:56:01 CST 2002


I'm no ASP expert, but it seems to be a reasonably straightforward string
manipulation. I would look for the space before and after the 80 mark, and
set yourself a margin of error. If you can allow 75 to 85, say, you would
look for the value closest to 80.

eg. string = "..... penultimate word"
say the 80 mark is on the 'u', it would be better to miss off 'penultimate'.
If the 80 mark was 'a' then it would be more logical to include
'penultimate'.

If the word is very long, you might need to crop it. This would occur if
spaces didn't occur either side of the margin of error. You might want to
crop the string at 78 and add 2 dots to show it has been cropped.

To create a drop down menu of a specific size, you can make the first
element 80 x   This has the disadvantage of creating a useless element.
You could append  's (80 - string length) to one (or all) of the
elements.

One nice idea that I toyed with for a while was each element have it's own
ALT tag, with the full title. I didn't manage to find a way, but if it were
possible, would allow the user to see the whole thing without mucking up the
design layout. It's nice to dream...

Phil Parker

-----Original Message-----
From: thelist-admin at lists.evolt.org [mailto:thelist-admin at lists.evolt.org]On
Behalf Of P. Z.
Sent: 05 February 2002 21:19
To: thelist at lists.evolt.org
Subject: [thelist] ASP question: the string is too long for the pulldown
menu


[ Converted text/html to text/plain ]
Hi everyone!
I tried but I couldn't find the answer in the archive.  So here is the
question:

I am working on an ASP page.  The database is Access.  I pulled out all the
keywords from the database and put them into a pulldown menu, which are all
the keywords for some projects. Some of the strings are really long (don't
ask
me why the keywords are so long), they are longer than my table width (I
can't
change the design at this stage).  So I used "Left(rs("keyword"),80)"
function
to cut the string.  But I have a problem here: I don't want the last word to
be cut in half.  What I like is that the user should be able to see the
complete last word such as "policy" instead of "poli".  I know I can search
for the nearest space after position 80, but is there any other way to
handle
this?  Any suggestions?  How do you set the width of a pulldown menu? Can
you?

Thank you for any help.
Z.P.

----------------------------------------------------------------------------
--
免费下载 MSN Explorer:http://explorer.msn.com/lccn/intl.asp[1]。

===References:===
  1. http://go.msn.com/bql/hmtag_etl_CN.asp

--
For unsubscribe and other options, including
the Tip Harvester and archive of thelist go to:
http://lists.evolt.org Workers of the Web, evolt !




More information about the thelist mailing list