Click to See Complete Forum and Search --> : TextArea Input


jacknbey
05-04-2005, 01:22 PM
Hi,

I encountered a funny case where I tried to assign a value into the <textarea>. It does not start at the position 0, it has few indentations of TABs where I cannot figure out where that come from.

Anyone has any idea?

It hows like this (with 2 TABs):-
+--------------------------+
|(TAB)(TAB) User name
|
+--------------------------+

What I really like is to have this:-
+--------------------------+
|User name
|
+--------------------------+

Regards,
Jack Kee

Fang
05-04-2005, 01:35 PM
Need more information; the html and how the text is being inserted.

jacknbey
05-04-2005, 06:53 PM
Actually quite a simple one using ASP.

<textarea rows=24 cols=35 name=userList>
<%

sql="select distinct Username from Users where Migration='"&varValue&"'"
rs.open sql, conn, 0, 1

if rs.eof then
else
rs.movefirst
counter=1
do while not rs.eof
varUsername = trim(rs("Username"))
if varUsername <> "" then
response.write chr(13) & chr(10) & varUsername end if
counter=counter + 1
rs.movenext
loop
rs.close
end if
%>
</textarea>

It should extract the names from the SQL database and write to the textarea line by line. The problem is it will first write 2 TABs on the first line, and one TAB on the last line. I have no idea why this happen...

Thanks.