jonnyfolk has asked for the wisdom of the Perl Monks concerning the following question:
I have a simple form with a few fields directed to a text file.
One of the fields is a textfield. When this is filled in without new line (carriage return) there is no problem and the field is recorded normally. However if the user uses the carriage return to begin a new line this starts a new line in the text file.
I have tried stripping out new lines and / or carriage returns but this strips out the whole response for that field.
I'd be grateful for some help on this.my $address=$query->param('address'); my $address =~ s/\n/<br>/g; my $address =~s/\r//g;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to handle new lines in textfield (CGI)
by dga (Hermit) on Mar 28, 2003 at 23:47 UTC | |
by jonnyfolk (Vicar) on Mar 29, 2003 at 07:44 UTC | |
|
Re: How to handle new lines in textfield (CGI)
by perlguy (Deacon) on Mar 28, 2003 at 23:50 UTC |