torrus, RT#10574
[freeside.git] / httemplate / elements / select-torrus_serviceid.html
index a8cfca8..34e8e93 100644 (file)
@@ -5,7 +5,9 @@
 % }
 
 % foreach my $serviceid ( keys %serviceid ) {
-    <OPTION VALUE="<%$serviceid%>"><% $serviceid %></OPTION>
+    <OPTION VALUE="<%$serviceid%>"
+            <% $serviceid eq $value ? 'SELECTED' : '' %>
+    ><% $serviceid %></OPTION>
 % } 
 
 </SELECT>
@@ -14,6 +16,8 @@
 
 my %opt = @_;
 
+my $value = $opt{'curr_value'} || $opt{'value'};
+
 #is this going to get too slow or will the index make it okay?
 my $sth = dbh->prepare("SELECT DISTINCT(serviceid) FROM srvexport")
   or die dbh->errstr;