PDA

View Full Version : White Space Handling


jwnelson
09-15-2005, 02:23 PM
How do I preserve whitespace within an element of a list selection. I am presenting a list of clients for single selection, but if I have a selection that has additional spaces in it, the spaces are removed when presented in the browser

I want to preserve the additional space within the client name presented in the list.

eg. 1
<TABLE border="0" width="876">
<TBODY>
<TR>
<TD height="10">&nbsp;</TD>
</TR>
<TR>
<TD width="700" valign="top">
<FORM method="POST" action="<%=applicationHome%>/transferID" name="theForm">
<TABLE width="100%">
<CAPTION align="left"><B>Select Client ID</B></CAPTION>
<TBODY>
<TR>
<TD height="5"></TD>
<TD></TD>
<TD></TD>
</TR>
<TR>
<TD width="45%">
<FIELDSET><LEGEND align="top">Clients</LEGEND> &nbsp;<%
int numberOfClients = clients.size();
int clientShowSize = 5;
if (numberOfClients < 5) {
clientShowSize = numberOfClients;
}
Iterator clientList = clients.iterator();
%> &nbsp;&nbsp;&nbsp;<SELECT name="clients" size="<%=clientShowSize%>">
<%
while (clientList.hasNext()) {
String client = (String)clientList.next();
%>
<OPTION><%= client %></OPTION>
<%
}
%>
</SELECT><BR>
&nbsp;<BR>
</FIELDSET>
</TD>
</TR>
<TR>
<TD height="5"></TD>
<TD></TD>
<TD></TD>
</TR>
<TR>
<TD width="45%" valign="top" align="center"><INPUT type="submit" name="action" value="Continue"> </TD>
<TD width="5%"></TD>
<TD width="45%"></TD>
</TR>
</TBODY>
</TABLE>
</FORM>
</TD>
</TR>
</TBODY>
</TABLE>

RetroGamer1991
09-21-2005, 09:50 PM
dont use &nbsp;

put the spaces in quotes

" whatever "

you may have to mix your quotes, use single and double, but you need to put them in some kind of quotes in your ASP code