bug report update

Colin Allen colin at snaefell.tamu.edu
Tue Feb 9 20:15:48 PST 1999


I had previously sent a message to this list reporting a bug with  
newlines in textareas using OmniWeb, but I've now looked a bit more at the  
problem and realize that the problem actually lies in the way that hidden  
parameters are handled by OW.

Specifically, newline characters are lost from text strings that are  
passed as hidden cgi parameters.

A perl script to demonstrate this effect is shown below.  You can try  
this script out at http://grimpeur.tamu.edu/cgi-bin/hiddenbug.cgi

(Press the reload button to see what happens to the parameters passed in  
the different ways - Netscape will preserve the multiline formatting with  
both methods; OmniWeb turns the input into one line when passed as a  
hidden parameter.)

Looks like a bug that should be fixed, but if anyone can suggest a good  
workaround in the interim, please let me know.

---
Colin Allen
http://snaefell.tamu.edu/~colin/

--

#!/bin/perl
use CGI;
$cgi = new CGI;

my $text = $cgi->param('text');

$text =~ s/\r//g; # get rid of unwanted CRs
my $hiddentext = $cgi->param('hiddentext');

$cgi->delete_all;

print
    $cgi->header,
    $cgi->start_html;

print "<b>Textarea version:</b><pre>$text</pre>" if $text;

print "<b>Hidden parameter:</b><pre>$hiddentext</pre>" if $hiddentext;

$text = "line 1\nline 2\nline 3\n" unless $text;

print
    $cgi->startform(),
    $cgi->hidden('hiddentext',$text),
    $cgi->textarea('text',$text,10,50),
    "<br>",
    $cgi->submit(-value=>'Reload'),
    $cgi->endform(),
    $cgi->end_html();



More information about the OmniWeb-l mailing list