http://www.perlmonks.org?node_id=919793

PerlOnTheWay has asked for the wisdom of the Perl Monks concerning the following question:

<select name="province_id" id="province"> <option value="-1">--</option> <TMPL_LOOP NAME="provinceloop"> <option value="<TMPL_VAR NAME="id">"> <TMPL_VAR NAME="name"></option> </TMPL_LOOP> </select>
The above is my code to show a select element populated with various option. But how do I add selected=true to those options when <TMPL_VAR NAME="id"> eq <TMPL_VAR NAME="current_key">?