Adding <br> automatically with "return" key ?

J

Jimbo

Hello,

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
script:
http://mosaikum.org/sonst/pws.html

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
appreciated.

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top