This pops up on the list pretty often, and there are lot's of different preferred solutions, differing in complexity, knowledge of the possible variables in the code, use of additional modules such as HTML::FillInForm (?), and "cleanliness".
it might be worth searching the archives: http://bluedot.net/mail/archive/ my personal preference is kind of dirty, but simple - set a variable to whatever was selected, then do the following: <select name="myname"> <option SELECTED><TMPL_VAR NAME="myname"> <option>the rest of the options, however you put them in (HTML or TMPL_LOOP) </select> the downside is that the selected option is going to show up on the list twice, and you should provide a reasonable default ("---" perhaps) if they hadn't selected anything (i.e. when the page first loads). hth - Jody Biggs Simon Crute wrote: >Hi all. > I'm using HTML::Template to build some <option>, which works fine. But, I >can't seem to figure out a quick way to set pump SELECTED into the correct ><option> without having to completely parse the list for each request. Since >most of these <option> lists are generated from a database, and I'll be >making my scripts persistent via CGI::Fast, It seems silly to have to read >the entire list just to set the SELECTED flag on one item. > >Is there a better way to do this that I'm missing ? > > > >-- >Simon Crute > > > >--------------------------------------------------------------------- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
