Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jun 28, 2010 09:02 PM by saljoo
Member
298 Points
292 Posts
Jun 25, 2010 08:34 AM|LINK
hi all how are u?
i have TextArea , when the user Press Enter to Start New Line , But the the Text Appear on the same Line , for Example:
hi
how are u?
its displayed as: hi how are u? i want it to be as:
Q2. if i add new row to my table (it will be at the top of rows), how i can set and focusing the screen on the first row?
thank u
All-Star
53942 Points
8147 Posts
Jun 25, 2010 05:53 PM|LINK
by default text Area allows carriage return.
it will be helpful if you can post the html of the page.
Jun 25, 2010 07:27 PM|LINK
may be u dont uderstand what i mean,
for example assume that the text in TextArea:
when i display it in div it will be:
hi how are u ?
it should be as Follow:
Hi
to do it Programmatly it will be:
hi <br/>how are u?
but the user cannot do it !!
Star
9370 Points
1580 Posts
Jun 25, 2010 07:38 PM|LINK
And how do you set text to div. if you do that in javascript, then when you assign it do div, simply do a replace over \n to <br/>, it will work.
Jun 25, 2010 07:41 PM|LINK
for example in javascript:
document.getElementById('divIDhere').innerHTML = document.getElementById('TextBoxhere').value.replace("\n","<br/>");
Jun 25, 2010 08:07 PM|LINK
i will test it as soon as possible
Participant
1005 Points
212 Posts
Jun 26, 2010 06:12 AM|LINK
Whenever u press an Enter Key in the TextArea. It will five u '/n' in the HTML. You can use this identifier to check multiple lines inside the textarea.
Contributor
2394 Points
421 Posts
Jun 26, 2010 06:16 AM|LINK
u can do something like this
<textarea id="txtArea" onblur="document.getElementById('lblText').innerHTML=this.value.replace('\n','<br/>')" cols="10" rows="5"></textarea> <label id="lblText" runat="server" > rizwan parkar</label>
Jun 26, 2010 09:35 AM|LINK
thank u very muccccccch about great answers
Jun 26, 2010 11:47 AM|LINK
hi,
this is work for first line only
for example Iput :
How Are U?
are u ok?
=========================
the Out Put :
how are u ? are u ok?
my target to Make output as Following:
SALJOO
Member
298 Points
292 Posts
Text Area and new Line how?
Jun 25, 2010 08:34 AM|LINK
hi all how are u?
i have TextArea , when the user Press Enter to Start New Line , But the the Text Appear on the same Line , for Example:
hi
how are u?
its displayed as: hi how are u? i want it to be as:
hi
how are u?
Q2. if i add new row to my table (it will be at the top of rows), how i can set and focusing the screen on the first row?
thank u
sansan
All-Star
53942 Points
8147 Posts
Re: Text Area and new Line how?
Jun 25, 2010 05:53 PM|LINK
by default text Area allows carriage return.
it will be helpful if you can post the html of the page.
SALJOO
Member
298 Points
292 Posts
Re: Text Area and new Line how?
Jun 25, 2010 07:27 PM|LINK
may be u dont uderstand what i mean,
for example assume that the text in TextArea:
hi
how are u?
when i display it in div it will be:
hi how are u ?
it should be as Follow:
Hi
how are u?
to do it Programmatly it will be:
hi <br/>how are u?
but the user cannot do it !!
SSA
Star
9370 Points
1580 Posts
Re: Text Area and new Line how?
Jun 25, 2010 07:38 PM|LINK
And how do you set text to div. if you do that in javascript, then when you assign it do div, simply do a replace over \n to <br/>, it will work.
SSA
Star
9370 Points
1580 Posts
Re: Text Area and new Line how?
Jun 25, 2010 07:41 PM|LINK
for example in javascript:
document.getElementById('divIDhere').innerHTML = document.getElementById('TextBoxhere').value.replace("\n","<br/>");
SALJOO
Member
298 Points
292 Posts
Re: Text Area and new Line how?
Jun 25, 2010 08:07 PM|LINK
thank u
i will test it as soon as possible
Naved Hasan ...
Participant
1005 Points
212 Posts
Re: Text Area and new Line how?
Jun 26, 2010 06:12 AM|LINK
Whenever u press an Enter Key in the TextArea. It will five u '/n' in the HTML. You can use this identifier to check multiple lines inside the textarea.
rizwanparkar
Contributor
2394 Points
421 Posts
Re: Text Area and new Line how?
Jun 26, 2010 06:16 AM|LINK
u can do something like this
<textarea id="txtArea" onblur="document.getElementById('lblText').innerHTML=this.value.replace('\n','<br/>')" cols="10" rows="5"></textarea>
<label id="lblText" runat="server" > rizwan parkar</label>
If the post helps you, please Mark it As Answer.
regards
-------------------
Rizwan Hanif Parkar
SALJOO
Member
298 Points
292 Posts
Re: Text Area and new Line how?
Jun 26, 2010 09:35 AM|LINK
thank u very muccccccch about great answers
SALJOO
Member
298 Points
292 Posts
Re: Text Area and new Line how?
Jun 26, 2010 11:47 AM|LINK
hi,
this is work for first line only
for example Iput :
Hi
How Are U?
are u ok?
=========================
the Out Put :
hi
how are u ? are u ok?
=========================
my target to Make output as Following:
hi
how are u?
are u ok?