Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks,
I use CGI.pm to create submit buttons but I am wondering if there is a way to set a standard size for the buttons, irrespective of the text.
For example, the below code works fine and creates the buttons, but of different sizes.
... .. print $query->table( {-border=>0, -cellpadding=>2, -cellspacing=>0 }, $query->Tr( [ $query->td( [ $query->submit( -name=>'name1', -value=>'Help'), " ". $query->submit( -name=>'name2', -value=>'Perform Action +', -onclick=>"submitform('action')" ), " ". $query->submit( -name=>'name3', -value=>'Outputs', -onc +lick=>"submitform('output')" ) ]), ]) ); ... ... ...
I can overcome the problem by 'manually', introducing spaces 'in front' and 'after' the text like
... .. $query->submit( ...., -value=>' Help ', .... ) ... $query->submit( ....., -value=>' Outputs ', .... ...
but the issue is, these buttons have to be generated dynamically based on what I read in the previous script. So, it can be a minimum of 2 to maximum of 'N' buttons and hence, it would be nice to define a standard size for the button.
Is there a way to achieve this? Please help.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: CGI: How to set a standard size for a SUBMIT button
by Joost (Canon) on Nov 23, 2006 at 14:55 UTC | |
by Anonymous Monk on Nov 23, 2006 at 15:43 UTC |