Asp problem returning data from Session in an Input statement
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>
Last edited by jazzyj99; 10-06-2006 at 10:56 AM.
Reason: fixed code
Your code should work , no need to do any thing unless the css class=body has some ficed length assigned to it
Still doesn't work
It should work, but for some glitch it isn't. I even took my css style out of it.
Any ideas??? Please help.
try to write response.write after the input statement, and see the value.
or post your page code here , we will see if there is a problem
Add quotes (single or double, just be consistent) around the <%..%> tags, like this:
Originally Posted by jazzyj99
so the HTML looks like this:
<input maxlength=60 size=40 value='<%=Session("title")%>' 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).
<input maxlength=60 size=40 value=word1 word2 class=body disabled>
Beautiful. thanks it worked great:)
Thanks for your assistance
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)