mtmcc has asked for the wisdom of the Perl Monks concerning the following question:
I'm sure this must be an age old question, with a definite answer, but I can't seem to find it.
I'm trying to make a CGI form with CGI.pm, which uses some textfields, and some textareas.
As an example:
#!/usr/bin/perl use strict; use warnings; use CGI; use CGI::Carp qw(fatalsToBrowser); my $q = new CGI; print $q->header; print $q ->start_form; print "<br><br>"; print $q->textfield( -name => 'field', -value => 'field', -size => 100, -maxlength => 100, ); print "<br>"; print $q->textarea( -name => 'area', -value => 'area', -rows => 2, -columns => 100, ); print $q ->end_form;
The problem is that the widths of the fields vary differently with different browsers, and I would like the widths of the textarea and textfield to be the same on each browser.
My short-term solution is to use HTTP::DetectBrowser, and set browser-dependent values for the textarea( -columns). Clearly, this isn't a very smart way to do it.
Does anyone know how to get around this, using perl cgi?
Thanks for your time
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: perl CGI: textfield and textarea width variability
by marto (Cardinal) on Jan 23, 2014 at 11:21 UTC | |
|
Re: perl CGI: textfield and textarea width variability
by tangent (Parson) on Jan 23, 2014 at 13:09 UTC | |
|
Re: perl CGI: textfield and textarea width variability
by ww (Archbishop) on Jan 23, 2014 at 13:14 UTC |