I have an asp page trying to display data from a sql database. The database has a field where there are 2 words in a record (i.e. Web Developer). When I do a response.write Session("title"), I get everything in the field, (i.e. Web Developer). When I place the same code into my <input> statement, it only returns Web and not anything after a [SPACE]. Can someone please tell me what I need to do to get the whole result and not just partial??
<input maxlength=60 size=40 value=<%=Session("title")%> class=body disabled>
Add quotes (single or double, just be consistent) around the <%..%> tags, like this:
<input maxlength=60 size=40 value='<%=Session("title")%>' class=body disabled>
so the HTML looks like this:
<input maxlength=60 size=40 value='word1 word2' class=body disabled>
What's happening is that the browser is seeing this (for example):
<input maxlength=60 size=40 value=word1 word2 class=body disabled>
so it's interpreting the value of the textbox as "word1", and ignoring "word2" (or rather, most browsers will treat it like an element property, and only ignore it if it's not a recognized property of a textbox).