Thanks Sam. I try to stay away from CGI.pm. In my opinion, it should have
been named HTML.pm. <smile> I just don't need all the HTML'ish routines. I
use CGI:Simple.

The suggestion from Puneet looks great. I don't have any problem with it.
Yet.... :)

By way of suggestion, the way HTML::Template has various "__first__,
__last__, __counter__" helper fields, I wish there were a way to inform a
loop of a special value used to indicate the row that should get the
"selected" attribute. It seems like there's a lot of pragmatic helpers
available, but nothing for what is a very basic HTML construct. Why not a
reserved variable name like __selected__ and HTML::Template would fill it in
automatically if a corresponding boolean is true for that row? Would this be
any more efficient (or beautiful) than Puneet's suggestion?

It just seems to me like "selected" and "checked" are fairly basic and
there's no easy (more built-in) way to accomodate them. It seems like you
recognize that they require a bit of ugliness. Why not provide for them
somehow? It couldn't add more overhead than the loop variables mentioned
above. (I support your quest to keep it clean and fast!).

Mark


----- Original Message ----- 
From: "Sam Tregar" <[EMAIL PROTECTED]>
To: "Mark Fuller" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, May 03, 2004 8:42 PM
Subject: Re: [htmltmpl] Select/option How to set "selected"?


> On Mon, 3 May 2004, Mark Fuller wrote:
>
> > How can I specify a row should be "selected"? The TMPL_VAR named "VAL"
is a
> > numeric index. If I could use TMPL_IF and concatenate the value of
"VAL", I
> > think it would work.
>
>  I just use CGI.pm's popup_menu().  I find that it's pretty rare for
> HTML designers to need to do something to the form tags themselves so
> I usually let CGI.pm to do the hard work for me.  You certainly can
> accomplish this with HTML::Template, but I don't think you're going to
> like the look of what it takes!
>
> -sam
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: Oracle 10g
> Get certified on the hottest thing ever to hit the market... Oracle 10g.
> Take an Oracle 10g class now, and we'll give you the exam FREE.
> http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
> _______________________________________________
> Html-template-users mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/html-template-users



-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE. 
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
_______________________________________________
Html-template-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/html-template-users

Reply via email to