473,385 Members | 1,712 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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

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
2 3133
tharden3
916 512MB
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
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

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

Similar topics

1
by: M Wells | last post by:
Hi All, I've been checking the online javascript libraries for code that will show me how to insert characters at the current cursor point in a textarea form field to help me markup content I...
3
by: Krzysztof Kujawski | last post by:
Hi Is there posibility to (and how to do this): a) add a string in the current cursor position? b) add string before and after selection in textarea e.g. selection c) if I put with...
3
by: PeP | last post by:
Good morning, I have a form containing a text-area, I'd like to know if it exists a function that, when I activate an event, returns the position of the cursor in the text-area. For example, I...
3
by: opt_inf_env | last post by:
Hello, I have created a form with a text-fields. <textarea name="explanation" rows=6 cols=70> </textarea> What I don't like there is that if I click in the middle or end of one of the...
4
by: Christopher Finke | last post by:
I am writing a Web-based text editor that will be used mainly for editing code. To facilitate this task, whenever the Enter button is pressed within the textarea, the event is caught and the next...
2
by: Michael | last post by:
Question 1 ---------------- I am writing an advanced BBCode system for my forums and I would like to be able to find where the cursor was positioned last in the text so I could insert the BBCode...
1
by: arash | last post by:
Hi! I am trying to write some ajax based IDE. I just cant get a div to open where the cursor in the textarea is blinking (in order to suggest possibilities..) Is there a way to get the exact...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.