By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,919 Members | 1,047 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,919 IT Pros & Developers. It's quick & easy.

How to set the cursor in the begging of the TextArea field?

P: 2
Hello,

I am having a problem to display my text in the beginning of the Textarea. For some reason It just keeps some spaces and then starts displaying. I am trying to display answers of selected questions into TextArea field. I am doing like this:

<tr>
<td width="30%">Email Message : </td>
<td width="70%">

<%
If faqchecklist <> "" Then
set rs1=server.createobject("ADODB.Recordset")
sql="select * from faq where faqid in (" & faqchecklist & ")"
rs1.Open sql,conn,2,2
%>
<textarea name="emailmessage" cols="50" rows="15">
<%
while not rs1.eof %>
<%=rs1.Fields("Answer")%> ;
<% rs1.MoveNext
wend
End If
rs1.close
set rs1=nothing
End If%>
</textarea>
</td>
</tr>

It displays answers starting in the middle of the textarea something like

Answer 1 is here -------
----------------------;

Answer 2 is here ------
-----------------------;

Last Answer -----------
------------------.;

SO it does automatically adds a line and goes to next line when there is more than one answer but it starts in the middle of the textarea. If I remove ';' from my code, then it displays all answer toghether like

Answer 1. Answer 2. Last Answer.

So I want to display my all answers in a new line staring from the begging of the text area like

Answer 1 - ---------------------------------------
--------------- .

Answer 2 - ---------------------------------------
-------------.

Last Answer - ----------------------------------
-------------.

Is that possible..? If it is please tell me how should I do that.? It is really urgent.

Thanks
Khushbu
Jul 23 '08 #1
Share this Question
Share on Google+
2 Replies


tharden3
100+
P: 916
Uhh, I'm relatively new to HTML... so I don't quite understand what you're asking, but a really great resource that has been cited and suggested by many expert hackers/programmers is HTMLdog.com. You can probably find an answer over there.
Jul 23 '08 #2

P: 2
Hi,

Anyways I found my answer.

If I use Chr(13) and Chr(10),then I can display my each answer in a new line starting at the beginning of the textarea field. I tried like

<%
If faqchecklist <> "" Then
set rs1=server.createobject("ADODB.Recordset")
sql="select * from faq where faqid in (" & faqchecklist & ")"
rs1.Open sql,conn,2,2
If NOT rs1.eof Then %>
<textarea name="emailmessage" cols="50" rows="15"><%
while not rs1.eof
Response.Write(rs1.Fields("Answer"))
Response.Write(Chr(13)+ Chr(10))
Response.Write(Chr(13)+ Chr(10))
rs1.MoveNext
wend
End If
%>
</textarea>

So my output in textarea field is like:

Answer 1 We are aware that there is a programming issue with the WebNote notification of missing and late work. The problem is related the the counter that keeps track of the missing and late assignment for each student.

Answer 2 To move student grades for an assignment follow the steps below:1. Login to WebGrader. 2. From the Help menu, send a support request for activation of the teacher.

Last Answer Superuser or Admin User accounts that you need. Be sure to specify what year is needed. 3. You will be contacted by e-mail when the accounts are active.

Thanks

Khushbu
Jul 24 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.