pull-down menu

Results 1 to 3 of 3

Thread: pull-down menu

  1. #1
    Join Date
    Dec 1969

    Default pull-down menu

    Hi! and thanks for all the useful information on ASP messageboard<BR> <BR>I have tried to find "easy" solutions to the problem below, so <BR>far no result. I have tried to solve it in a "farfetched" <BR>way, see below......please help. <BR><BR>I have a problem with displaying a "order list". I work with a e-<BR>commerce site, and all data are retrieved from SQL-databases. It <BR>will be possible to edit the entire site from a ordinary <BR>browser. <BR><BR><BR>I let all ordered items end up in a pull-down menu, so far it <BR>works great. <BR>The problem is to get all facts in straight columns. All letters <BR>and numbers have their own width, the differens between "M" <BR>and "I" for example. <BR><BR>I have a number of facts I would like to view in the pull-down <BR>menu: "article number, article name, color, type, price/item, <BR>number of items and total price" <BR><BR><BR>Now it looks something like below: <BR>123-23 MORGEDAL BLUE SWEATER $38 3 $114 <BR>143-643 BYCKLE GRAY SWEATER $41 2 $82 <BR><BR><BR>I have tried to get around this problem. One thing I have tried is to give every letter and number it&#039s own value, "M" have the <BR>value of 3, and "I" have the value of 1. Every data I get from <BR>the SQL-database will have to be checked, and every letters they contain must be given a value. I use a simple "Case of" routine. <BR><BR>Letter of a certain width have a specific value. I add <BR>every "letter value" together and then I give the sum to a <BR>variable, let&#039s call the variable "varSpace" <BR><BR>Then I use the value (varSpace) a certain word have obtained to <BR>make a space with the "right width" I use a "For - next" like <BR>below. <BR><BR>&#060;%=rs("art.nr") %&#062; <BR>&#060;% For n = 1 to (15 - len( rs("varSpace"))) %&#062; <BR>&nbsp; <BR>&#060;% next %&#062; <BR>&#060;%=rs("art.name") %&#062; <BR> .<BR> .<BR> .<BR><BR>The above would give a string in the pull-down menu like: <BR>123-23 MORGEDAL <BR><BR>Since the "article number" was "123-23" my "vaSpace" will be set <BR>to, let&#039s say 6, depending on the value of each number, and the <BR>value of "-". <BR>Above "For" loop gives us (15 - 6 = 9 ), nine spaces (&nbsp;) <BR>So the space between "123-23", and the word "MORGEDAL" contains <BR>9 spaces..... <BR><BR>The problem with above is that I can&#039t find any space command <BR>(&nbsp;) that can make a small enough space. The differens in <BR>width between some letters are smaller the space made by the <BR>(&nbsp;). <BR><BR><BR>Regards <BR>Kennet Carlsen<BR><BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: pull-down menu

    Response.write "test this" & Space(9) To see if you get 9 spaces between this and To<BR><BR>or in your case Space(vaSpace)<BR>

  3. #3
    James Mitchell Guest

    Default RE: pull-down menu

    It sounds like you are having HTML trouble and not ASP trouble.<BR><BR>What I think that you are trying to do is align your text columns in the drop down.<BR><BR>Actually you have two choices to solve this.<BR>1. Handle it Server-Side<BR>2. Handle it Client-Side<BR><BR>#1 - If you go the Server-side route, then it would be best to write a function that, given a string of text, an integer, and a boolean variable will return your new text formatted/justified to the left or right(depending on the boolean).<BR><BR>Example:<BR><BR>I even put a souce link there for you.<BR><BR>#2 - If you want to do the Client-Side route then let me know and I can build that for you too.<BR>jmitchtx@yahoo.com<BR><BR>James Mitchell

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts