on 01/31/2001 04:26 PM, Ronald J Kimball at
[EMAIL PROTECTED] wrote:

>>> Wait. I think Chris is talking about HTML, and Scott is talking about
>>> how CGI.pm *writes* HTML. In CGI.pm's HTML-writing methods,
>>> attributes are handled as name=>value pairs, so boolean variables as
>>> allowed in HTML don't work directly. I don't recall using it, but
>>> it's plausible to me that the boolean attribute 'disabled' would be
>>> coded in CGI.pm's methods as disabled=>'false' or disabled=>'true'.
>>> 
>>> Hmm?
>> 
>> you know, this is sounding more and more like I should send a 'bug report'
>> to Lincoln Stein about this..
>> 
>> because technically if 'disabled = false' it should return NO value (i.e.
>> the "disabled" bit should be missing from the resultant HTML.)
>> 
> 
> You seem to be under the impression that CGI understands HTML.  It
> doesn't.  It just takes the attributes and values given, and turns them
> into an HTML tag.  CGI is not at fault if those attributes and values are
> invalid.

You seem to be under the misapprehension that I don't understand the
difference between a perl script and html 'coding'.

> If you want the 'disabled' attribute to not appear in the HTML, don't
> include it in the call to the method.

What if I want the menu to be enabled or disabled based on the previious
user input, time-of-day, phase-of-the-moon?

it seems to me to be easier (and cleaner) to say {-disabled => $value} in
the popup hash than to toss that into an if-then, and have CGI.pm know what
to do with the result.

-- 
Scott R. Godin            | e-mail : [EMAIL PROTECTED]
Laughing Dragon Services  |    web : http://www.webdragon.net/


Reply via email to