Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Text boxes and white spaces in text.. how to fix?

Status
Not open for further replies.

KodoSan

Programmer
Sep 1, 2001
9
US
ok.. I'm still new to this and catching on fast .. what's the deal with pulling data to a text box. I have data that has spaces between the words. i.e. "New York" when I query the DB for it and have it show in text box all i get is "New". can someone point me in the right direction on how to get around this?
Thanks
Jim
 
Use Server.HTMLEncode to format it for a web page and Server.URLEncode when setting parameters in URLs.

Also sometimes it is helpful to view the source of the page that is getting you trouble so you can see the actual HTML that is being created by your ASP.
Wushutwist
 
Where would I specify this server variable. btw, here's the code for the page:

<!--#include file=&quot;subadmin.asp&quot;-->
<!--#include file=&quot;../../connection.asp&quot;-->
<!--#include file=&quot;../../adovbs.inc&quot;-->


<%
response.write &quot;Welcome to the Control Panel &quot; & session(&quot;user&quot;)

%>
<br
<br>
<FORM method=&quot;post&quot; action=&quot;edit.asp&quot;>
<%

Rs.open &quot;LAN&quot;, MyConn, adOpenForwardOnly,adLockOptimistic,adCmdTable

while not RS.EOF
response.write &quot;<table border=1 width=350 height=25>&quot;&_
&quot;<tr>&quot;&_
&quot;<td width=165 height=30><Input type=text name=&quot;&quot;FirstName&quot;&quot; value=&quot;& RS(&quot;FirstName&quot;)& &quot;>&nbsp;<input type=text name=LastName value=&quot;&RS(&quot;LastName&quot;)&&quot;>Name</td>&quot;&_
&quot;</tr>&quot;&_

&quot;<tr>&quot;&_
&quot;<td width=165 height=25><input type=text name=&quot;&quot;Street&quot;&quot; value=&quot;& RS(&quot;Street&quot;)& &quot;>Street</td>&quot;&_
&quot;</tr>&quot;&_

&quot;<tr>&quot;&_
&quot;<td width=165 height=25><input type=text name=&quot;&quot;City&quot;&quot; value=&quot;& RS(&quot;City&quot;)& &quot;>City</td>&quot;&_
&quot;</tr>&quot;&_

&quot;<tr>&quot;&_
&quot;<td width=165 height=25><input type=text name=&quot;&quot;State&quot;&quot; value=&quot;& RS(&quot;State&quot;)& &quot;>State</td>&quot;&_
&quot;</tr>&quot;&_

&quot;<tr>&quot;&_
&quot;<td width=165 height=25><input type=text name=&quot;&quot;Zip&quot;&quot; value=&quot;& RS(&quot;Zip&quot;)& &quot;>Zip</td>&quot;&_
&quot;</tr>&quot;&_

&quot;<tr>&quot;&_
&quot;<td width=165 height=25><input type=text name=&quot;&quot;Phone&quot;&quot; value=&quot;& RS(&quot;Phone&quot;)& &quot;>Phone_Number</td>&quot;&_
&quot;</tr>&quot;&_

&quot;<tr>&quot;&_
&quot;<td width=165 height=25><input type=text name=&quot;&quot;Nick&quot;&quot; value=&quot;& RS(&quot;Nick&quot;)& &quot;>Screen_Name</td>&quot;&_
&quot;</tr>&quot;&_

&quot;<tr>&quot;&_
&quot;<td width=165 height=25><input type=text name=&quot;&quot;Attend&quot;&quot; value=&quot;& RS(&quot;Attend&quot;)& &quot;>Attending_Date</td>&quot;&_
&quot;</tr>&quot;&_

&quot;<tr>&quot;&_
&quot;<td width=165 height=25><input type=text name=&quot;&quot;Deposit&quot;&quot; value=&quot;& RS(&quot;Deposit&quot;)& &quot;>Deposit_Amount</td>&quot;&_
&quot;</tr>&quot;&_
&quot;</table>&quot;&_

RS.MoveNext
Wend

RS.close
MyConn.close
set RS=Nothing
set MyConn=Nothing
%>
<input type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;Make Changes&quot;>
</form>
 
value='&quot;& RS(&quot;State&quot;)&&quot;'
that solved it! had to srround my statement in apostrophe's
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top