aadlar
Posts: 1
|
Posted: 05/07/2004, 6:13 AM |
|
Hi,
Is there any ways of of making a line break when entering text in TEXTAREA field using the enter/return key to seperate the lines or paragraphs
Thanks
|
|
|
Nicole
Posts: 586
|
Posted: 05/12/2004, 1:59 AM |
|
Hello,
You can replace <br> tags from text fields with line break character before output value in TextArea. It can be done in Before Show event, here is PHP example:
$fldtextArea_name = str_replace("<br>", "\n", $fldtextArea_name);
_________________
Regards,
Nicole |
|
|
Alex
|
Posted: 05/12/2004, 6:03 AM |
|
Thank you,
The problem is I'm not using PHP, is there any way it can be done in JavaScript (or VBScript)
Thanks
|
|
|
parsam
|
Posted: 05/27/2004, 10:40 PM |
|
This works
fldarticle_desc = replace(fldarticle_desc,chr(13),"<br>")
|
|
|
powerfinger
Posts: 5
|
Posted: 12/21/2004, 9:57 AM |
|
Hi,
I've tried
fldarticle_desc = replace(fldarticle_desc,chr(13),"<br>") like stated above, but I only get "<br>" showing up in my output.
If I look at the source, I get "<br>" appearing where a proper carriage return should occur.
What am I doing wrong?
Thanks!
PF
|
|
|
Stefan Hogedal
|
Posted: 01/04/2005, 3:20 PM |
|
You have to set the field type to HTML.
|
|
|
powerfinger
Posts: 5
|
Posted: 01/14/2005, 6:31 AM |
|
Hi Stefan,
Thanks... Where is this "field type" you are referring to?
In CodeCharges interface, in the Field Type, there isn't an "HTML" to select from, I've just got Textbox, URL, Hidden, Label, Lisbox, TextArea, Checkbox, RadioButton... obviously I'm looking in the wrong place.. would you mind explaining a little more?
Thanks again,
PF
|
|
|
Nicole
Posts: 586
|
Posted: 01/19/2005, 2:17 AM |
|
Hello,
Please open TextArea Properties and make HTML flag selected.
_________________
Regards,
Nicole |
|
|
powerfinger
Posts: 5
|
Posted: 01/20/2005, 5:10 PM |
|
I've looked and looked... I have no clue where you set this...
The only items listed when I click on TextArea Properties is
Name (Textbox)
Default Value (Textbox)
Data Type (Number, Date, Text, Memo)
Rows (Textbox)
Unique (checkbox)
Required (checkbox)
I am using CodeCharge 2.0.7... where are you setting this?
Thanks,
Pf
|
|
|
beau
|
Posted: 01/23/2005, 12:36 AM |
|
Hi guys,
i am having the same problem when trying to make a line break,
i am using this command
Quote :fldarticle_desc = replace(fldarticle_desc,chr(13),"<br>")
But nothing happens at all....
where abouts on my page do i insert this command, and do i have toi change it at all or do i simply leave it like this...
Thanx Guys,
If someone could help me it will be most apreciated...
|
|
|
Dean
|
Posted: 02/18/2005, 3:47 PM |
|
To convert back to visual line breaks inside a textarea after having converted them to <br>, use this:
fixedtext = replace(originaltext,"<br>","\n")
|
|
|
test
|
Posted: 03/09/2005, 12:35 AM |
|
test
test
test
|
|
|
test
|
Posted: 03/09/2005, 12:35 AM |
|
<font size=72>test</font>
|
|
|
powerfinger
Posts: 5
|
Posted: 03/09/2005, 6:11 AM |
|
Hi,
I've been messing with this one forever it seems, and nothing I do works.
'Before Show Event
fldComments = replace(fldComments, "<br>", "\n"))
'End of Before Show Event
Just causes this in my field...
Here is one point.\nAnd another point.\n
It seems nomatter what I put in the "replace with" section, gets substituted in as ACTUAL text, rather than HTML code. (I've tried removing the quotes, I've tried searching for CHR(13) rather than <br>.
Am I losing my mind over this? Yes...
Thanks,
Powerfinger
|
|
|
same problem
|
Posted: 03/11/2005, 8:10 PM |
|
I had the same problem. I was able to do a Substitute (or replaces using an escape sequence, so code would be
fldComments = replace(fldComments, "<br>, "
")
worth a try...
|
|
|
same problem
|
Posted: 03/11/2005, 8:11 PM |
|
Quote same problem:
I had the same problem. I was able to do a Substitute (or replaces using an escape sequence, so code would be
fldComments = replace(fldComments, "<br>", "
")
worth a try...
|
|
|
Lex
|
Posted: 03/11/2005, 8:16 PM |
|
I have a textarea where input data is received. In order to show line breaks as they were typed, I do a replace of the <br> with the escape sequence
in quotes.
|
|
|
Laz
|
Posted: 05/01/2005, 6:08 AM |
|
Try this:
Replace(whatever,"<br>",chr(13)&chr(10))
|
|
|
Solster
|
Posted: 06/25/2005, 1:02 PM |
|
It works when you replace with "\n" in double quotes, and doesn't work in single quotes. Donno why.
<textarea name="Address" rows="5" cols="35"><?php echo str_replace('<br>', "\n", $myrow["Address"]); ?></textarea>
|
|
|
wkempees
Posts: 1679
|
Posted: 06/26/2005, 6:19 AM |
|
In your SQL select, that's when getting the record from the database you could do this
replace(sql.field,char(10),'<br>')
thereby replacing on the fly. Nice for reporting purposes.
_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)
if you liked this info PAYPAL me: http://donate.consultair.eu
|
|
|
alireza
|
Posted: 07/03/2005, 10:58 PM |
|
u can used function:
nl2br(whatever)
in PHP.
|
|
|
jhertzberg
|
Posted: 07/13/2005, 10:05 AM |
|
repeat the newline twice:
<textarea ....>\n\n</textarea>
|
|
|
Pin
|
Posted: 07/20/2005, 4:59 AM |
|
http://javascript.programmershelp.co.uk/scrolltext.php
shows you how in jscript
|
|
|
Madhan
|
Posted: 08/24/2005, 1:59 AM |
|
Hi,
Is there any option to replace the text contents with out deleting exisiting text value
Lets say textvalue is 55555. I wanna change that to 11111.
For this I found two methods,
1) Delete 55555 and enter 11111
2) Press Insert key and type 11111
with out choosing Insert key and deleting the content Is there any other way.
Regds, Madhan
|
|
|
Bobbytar
|
Posted: 08/28/2005, 12:27 PM |
|
This whole conversation totally helped me. Thank you all so much.
|
|
|
Covenant.Child
|
Posted: 09/25/2005, 4:05 PM |
|
Yeah...I just had the same problem. Apparently, <textarea> is set to ignore all HTML markup. I've seen where the whole "replace(textareadata, char(13), '<br>')" thing worked, but I don't remember exactly...
However, what you can do is this: append the <pre>...</pre> tags before and after the textarea data before you process it finally. For instance, if i'm saving data in a textarea field named "USERTEXT" to a database, my SQL statement would be something like:
"update myTable set usertext = <pre>" & request("USERTEXT") & "</pre>"...blah blah blah.
Of course, this is VBScript. If it was PHP or something you'd use the '.' to concatenate the SQL string
Quote powerfinger:
Hi,
I've been messing with this one forever it seems, and nothing I do works.
'Before Show Event
fldComments = replace(fldComments, "<br>", "\n"))
'End of Before Show Event
Just causes this in my field...
Here is one point.\nAnd another point.\n
It seems nomatter what I put in the "replace with" section, gets substituted in as ACTUAL text, rather than HTML code. (I've tried removing the quotes, I've tried searching for CHR(13) rather than <br>.
Am I losing my mind over this? Yes...
Thanks,
Powerfinger
|
|
|
dumba
|
Posted: 10/12/2005, 4:07 AM |
|
|
|
|
guest
|
Posted: 11/13/2005, 4:18 AM |
|
I found this topic is helpful to me, and my solution for original question in ASP is:
text=replace(text,chr(13),"<br>")
text=replace(text,chr(10),"")
|
|
|
Tim
|
Posted: 11/16/2005, 4:27 AM |
|
I found this was the answer to the Javascript problem:- http://www.armbrustconsulting.com/forums/viewtopic.php?p=793#793
Essentially passing the /g flag to replace();
|
|
|
Myrddin
|
Posted: 12/09/2005, 10:13 AM |
|
If you're typing it in ASP, make sure to use this
= replace(Request("VariableName"), VbCrLf, "<br />")
This replaces the HTML breakline with the ASP breakline. Sovled my (similar) problem!
|
|
|
|