Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Adding <br> automatically with "return" key ?

Thread Tools

Adding <br> automatically with "return" key ?

Posts: n/a

I'm not a perl programmer but I can kind of hack my way through some
simple scripts. What I am trying to do is get it so a line break <br> is
automatically placed when I hit the return key in a text box in this

It will add the <br> automatically to the Add Story function, but not
the edit text function. I'm trying to get it to do it in the edit
function as well.

It looks like here's the bit of code that does it for the "Add Story"

if ($ueberschrift) {
$ueberschrift = "<br><b>".$ueberschrift."</b>";
$ueberschrift .= "\n";

$ueberschrift .= "<br>\n";
if ($linebreaks eq "yes") {
$text =~ s/\n/<br>\n/g;

I've tried adding that to this:

sub Bearb {

if (($filename =~ m/[^\w\.\-_]/i) or (not($filename =~ m/\.txt$/)) )
{$filename=""; $showerror='Error in Filename! Use only numbers, letters,
"_" and "-". <br> File MUST end with .txt'; &Auswahl; return;}

$title="Editing $filename";
open (WISHANDLE, "$filename");
while ($wisline = <WISHANDLE>) {
$wisvar .= $wisline;

close (WISHANDLE);
print qq!

but, since I don't know what I'm doing, it, understandably, didn't work.

Any info (i.e. something I can copy and paste) on this would be much

Reply With Quote
Posts: n/a

> Any info (i.e. something I can copy and paste) on this would be much
> appreciated.
> Thanks

Never mind... I figured it out.
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
The key is provided for me automatically .. =?Utf-8?B?c290?= Wireless Networking 1 03-01-2007 04:56 PM
is dll assembly automatically strongly named, (public key encrypti =?Utf-8?B?UGF1bA==?= ASP .Net 3 10-14-2005 02:52 PM
Distribute WAP key automatically SpiritBoy Wireless Networking 1 03-04-2005 05:55 PM
Replace Tab Key to Return Key (Enter Key) from Web Forms? M P ASP General 1 08-06-2004 08:32 AM