Solved

make listbox items include several space characters?

Posted on 2001-07-26
13
257 Views
Last Modified: 2013-11-18
how to list the following 3 items in listbox?
"test 1","test   2","test      3".
thanks!
0
Comment
Question by:jyx
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
  • 2
  • +2
13 Comments
 
LVL 5

Expert Comment

by:raizon
ID: 6324230
This would work.

<select size=4 multiple>
  <option value=1>test 1</option>
  <option value=2>test &nbsp;&nbsp;2</option>
  <option value=3>test &nbsp;&nbsp;&nbsp;3</option>
</select>
0
 

Author Comment

by:jyx
ID: 6324310
yes that is exactly what I'm using. In the listbox I show all the file names, and when the user click print button I will print those selected files. The file names look  exactly ok, however when I try to print them, it seems these "&nbsp;" is not real space character so I can not locate those files at all.
Help!
0
 
LVL 5

Expert Comment

by:raizon
ID: 6324385
can you show me the code you are using?
0
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 
LVL 19

Expert Comment

by:webwoman
ID: 6324579
What kind of files? If you're printing from the browser, you have to load it in the browser. If it's not an HTML doc, it's going to have to open in the proper app for you to print it.

Trying to force things to print from a browser is hard enough -- trying to make them print without loading them is pretty much an exercise in futility. You might be able to do it if you use some fancy ActiveX controls.
0
 
LVL 2

Expert Comment

by:Schells_Web_Design
ID: 6326832
As a variation on what  "raizon" stated earlier - how about this?

<select>
   <option value="test 1">test 1</option>
   <option value="test   2">test   2</option>
   <option value="test     3">test     3</option>
</select>
0
 
LVL 5

Accepted Solution

by:
raizon earned 50 total points
ID: 6326864
problem with that Schells would be calling on the selected value for that select box.  You want to keep your values as descriptive/usefull as possible, cause you are going to be calling on them later.  jyx is calling on them to point to either a URL or a File.  The spaces will cause problems with the user reaching the specified URI in some browsers such as Netscape.
0
 
LVL 2

Expert Comment

by:Schells_Web_Design
ID: 6327418
Gotcha - I agree on that one. I re-read the earlier posts and see what he's trying to do. I did not read into that the first time I read the posts.

0
 
LVL 18

Expert Comment

by:bruno
ID: 6327431
you should NOT have spaces in your filenames if you are trying to link to them....rename your files with underscore where all the spaces_were_before...

BRUNO
0
 

Author Comment

by:jyx
ID: 6327537
thanks everyone. I fixed that problem by using the VALUE property of the listbox item to pass the file names to my OCX to print them. I was very stupid to use the TEXT property of the listbox to pass the file names as the parameter.
0
 
LVL 5

Expert Comment

by:raizon
ID: 6327546
sounds great jyx.  Good luck and let us know if we can help further.
0
 

Author Comment

by:jyx
ID: 6327558
The following are my current code:
     
<%Set objFileSystem = CreateObject("Scripting.FileSystemObject")

Set objFolder = objFileSystem.GetFolder(filepath)

Set objFiles = objFolder.Files
If objFiles.Count > 0 Then
For Each objItem in objFiles%>

<option value="<%=filepath & "\" & objitem.name%>">
<%filenamenew= replace(objitem.name," ","&nbsp;")
response.write filenamenew%>
</option>

<%Next
End If%>
0
 

Author Comment

by:jyx
ID: 6327567
Anyway thanks for all your help. I appreciate that.
Good luck and enjoy your programming!
0
 
LVL 5

Expert Comment

by:raizon
ID: 6327835
Only thing that I would change jyx is in your replace statment.  

Change

<option value="<%=filepath & "\" & objitem.name%>">
<%filenamenew= replace(objitem.name," ","&nbsp;")
response.write filenamenew%>
</option>

To

<option value="<%=filepath & "\" & objitem.name%>">
<%filenamenew= replace(objitem.name," ","%20")
response.write filenamenew%>
</option>


%20 is the URL encoding for a space.

Good luck and have fun.

BTW......thanks for the points and the A
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An enjoyable and seamless user experience can go a long way on an eCommerce site. While a cohesive layout and engaging copy play roles in creating a positive user experience, some sites neglect aspects that seem marginal but in actuality prove very …
FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question