Nathan Wiger | 5 May 22:54
Picon

[FB] pondering stylesheet change

I'm pondering changing the way that style classes are handled in 
CGI::FormBuilder 3.03. The current implementation is a bit redundant 
when looking at CSS more closely.

In FB 3.02, you get something like this:

   <form class="fb_form">
     <table class="fb_form">
        <tr class="fb_tr">
           <td class="fb_td"><input class="fb_input"></td>
           <td class="fb_td"><select class="fb_select"></td>

And so on. In your .css file you would create

    fb_form {}
    fb_tr {}
    fb_td {}
    fb_input {}
    fb_select {}

However, in CSS, the correct way to do this is:

    form.fb {}
    tr.fb {}
    td.fb {}
    input.fb {}
    input.select {}
    .fb {}   /* catch the rest */

As such, the HTML *should* just look like this:
(Continue reading)

Norton Allen | 6 May 16:49
Picon

Re: [FB] pondering stylesheet change

Nathan Wiger wrote:
> I'm pondering changing the way that style classes are handled in 
> CGI::FormBuilder 3.03. The current implementation is a bit redundant 
> when looking at CSS more closely.
> 
> In FB 3.02, you get something like this:
> 
>   <form class="fb_form">
>     <table class="fb_form">
>        <tr class="fb_tr">
>           <td class="fb_td"><input class="fb_input"></td>
>           <td class="fb_td"><select class="fb_select"></td>
> 
> And so on. In your .css file you would create
> 
>    fb_form {}
>    fb_tr {}
>    fb_td {}
>    fb_input {}
>    fb_select {}
> 
> However, in CSS, the correct way to do this is:
> 
>    form.fb {}
>    tr.fb {}
>    td.fb {}
>    input.fb {}
>    input.select {}
>    .fb {}   /* catch the rest */
> 
(Continue reading)

Kirk Zurell | 6 May 16:59
Favicon

[FB] minimum version of perl?

Can anyone tell me the minimum version of perl needed to run 
FormBuilder? I looked for prerequisites in the distrib and on the website.

I'm a perl newbie, so I'm unfamiliar with the versioning conventions. 
Any tips on compensating for an older perl would be appreciated.

Thanks
Kirk.

These errors from FB 3.0201 don't look that grievous:

vinyl% perl -Ilib/ -c lib/CGI/FormBuilder.pm
Bareword "messages" not allowed while "strict subs" in use at 
lib//CGI/FormBuilder/Field.pm line 376.
Global symbol "$mess" requires explicit package name at 
lib//CGI/FormBuilder/Field.pm line 378.
syntax error at lib//CGI/FormBuilder/Field.pm line 308, near "$k;"
syntax error at lib//CGI/FormBuilder/Field.pm line 323, near "$k;"
syntax error at lib//CGI/FormBuilder/Field.pm line 376, near "$et
                     ||"
syntax error at lib//CGI/FormBuilder/Field.pm line 376, near 
"}->form_invalid_de
fault"
syntax error at lib//CGI/FormBuilder/Field.pm line 379, near "}"
BEGIN failed--compilation aborted at lib/CGI/FormBuilder.pm line 58.

vinyl% perl -v

This is perl, version 5.005_03 built for i386-freebsd
--

-- 
(Continue reading)

martin | 6 May 17:17

Re: minimum version of perl?

Kirk,
you seem to have  'use strict' in your program.. not a bad thing but
if you do that then you can only use a variables after declaring scope
like this:
my $localvar;
Also, the error message about the bareword messages will maybe
go away if you wrap it in quotes.
These are guesses without seeing the source code.
//Martin 

Kirk Zurell writes: 

> Can anyone tell me the minimum version of perl needed to run FormBuilder? 
> I looked for prerequisites in the distrib and on the website. 
> 
> I'm a perl newbie, so I'm unfamiliar with the versioning conventions. Any 
> tips on compensating for an older perl would be appreciated. 
> 
> Thanks
> Kirk. 
> 
> 
> These errors from FB 3.0201 don't look that grievous: 
> 
> vinyl% perl -Ilib/ -c lib/CGI/FormBuilder.pm
> Bareword "messages" not allowed while "strict subs" in use at 
> lib//CGI/FormBuilder/Field.pm line 376.
> Global symbol "$mess" requires explicit package name at 
> lib//CGI/FormBuilder/Field.pm line 378.
> syntax error at lib//CGI/FormBuilder/Field.pm line 308, near "$k;"
(Continue reading)

Norton Allen | 6 May 17:18
Picon

Re: [FB] pondering stylesheet change

Norton Allen wrote:
> This sounds reasonable to me, although if you want to be extra 
> efficient, you could leave out the class attributes for <tr> and
> <td>, since they are always nested inside <table>. Then your
> stylesheet could define:
> 
>   form.fb {}
>   form.fb tr {}
>   form.fb td {}

I meant:

   table.fb {}
   table.fb tr {}
   table.fb td {}

-N

Kirk Zurell | 6 May 17:40
Favicon

Re: minimum version of perl?

martin wrote:
> Kirk,
> you seem to have  'use strict' in your program.. not a bad thing but
> if you do that then you can only use a variables after declaring scope
> like this:
> my $localvar;
> Also, the error message about the bareword messages will maybe
> go away if you wrap it in quotes.
> These are guesses without seeing the source code.

All I was doing at this point was checking if FB would compile on the 
target machine. These errors came from FB's code.

My development machine has cygwin's 5.8.6, and FB works fine. The 
production server's perl is 5.005_03 (not my server); from the copyright 
statement this is circa 1999. Do you think it's likely that FB will run 
on such an old perl (despite being perl 5)? The errors didn't seem to 
suggest massive failure...

Thanks for any ideas.

Kirk.

--

-- 
Kirk Zurell
Byte Craft Limited
Waterloo, Ontario, Canada
http://www.bytecraft.com

(Continue reading)

Peter Eichman | 6 May 17:40
Picon
Picon

Re: [FB] pondering stylesheet change

Norton Allen wrote:
> Here's a question for anyone familiar with style for forms:
> should different <input> types get different classes, or is
> there another way to differentiate between, say, text and
> checkbox?

With CSS3 selectors, you can do stuff like this:

input[type="text"] { /* text input styles */ }
input[type="checkbox"] { /* checkbox styles */ }
select[multiple="multiple"] { /* multi-select box styles */ }

And so forth. See also http://www.splintered.co.uk/experiments/38/ for a 
related use (styling links differently based on their 'type' attribute), 
and http://www.xml.com/pub/a/2003/06/18/css3-selectors.html for an 
overview of CSS selectors, including CSS3.

Unfortunately, while CSS3 selectors are supported on Firefox and Safari, 
they are NOT supported on Internet Explorer. So the upshot is, for now, 
having classes for the different input elements may be the best bet.

hth,
-Peter

Will Hawes | 6 May 17:46
Picon

Re: [FB] pondering stylesheet change

----- Original Message -----
From: Norton Allen <allen <at> huarp.harvard.edu>
To: Nathan Wiger <nate <at> sun.com>
Cc: fbusers <at> formbuilder.org
Sent: Fri,  6 May 2005 15:49:01 +0100
Subject: Re: [FB] pondering stylesheet change

> 
> Here's a question for anyone familiar with style for forms:
> should different <input> types get different classes, or is
> there another way to differentiate between, say, text and
> checkbox?
> 
> -Norton Allen

IIRC, in CSS2 the more standards compliant browsers allow you to do:

input[type='text'] {}
input[type='checkbox'] {}

But I'm not sure about browser support. There are compatibility issues with the above, as well as with using
the "class" attribute on input elements. I tend to wrap each input element inside a div and style the div,
which works pretty well across browsers.

Good CSS resource: http://www.blooberry.com/indexdot/css/

WH

martin | 6 May 18:19

Re: minimum version of perl?

Apologies.. I didn't read the last line..
I have Formbulder 3.01 working on Perl 5.6 without problem. 

If it were me, I would focus on getting Perl upgraded rather than
trying to make a otherwise working module work on an old Perl..
it would mean a lot of work and would require some knowledge of
the differences between Perl 5.
What about using mod_perl in Apache? Is that an option?
Doesn't BSD support some sort of packaging system? 

Just throwing some ideas out.. 

//M 

Kirk Zurell writes: 

> martin wrote:
>> Kirk,
>> you seem to have  'use strict' in your program.. not a bad thing but
>> if you do that then you can only use a variables after declaring scope
>> like this:
>> my $localvar;
>> Also, the error message about the bareword messages will maybe
>> go away if you wrap it in quotes.
>> These are guesses without seeing the source code.
> 
> All I was doing at this point was checking if FB would compile on the 
> target machine. These errors came from FB's code. 
> 
> My development machine has cygwin's 5.8.6, and FB works fine. The 
(Continue reading)

Kirk Zurell | 6 May 18:34
Favicon

Re: minimum version of perl?

martin wrote:
> If it were me, I would focus on getting Perl upgraded rather than
> trying to make a otherwise working module work on an old Perl..

That's probably the tack I'll take. They're a large ISP, so they'll be 
cautious. I'm not sure why they're using such an old perl to begin with...

> What about using mod_perl in Apache? Is that an option?

mod_perl wants a separate perl executable...same problem...

Thanks
Kirk
--

-- 
Kirk Zurell
Byte Craft Limited
Waterloo, Ontario, Canada
http://www.bytecraft.com


Gmane