I have an html select element that, based on a value set elsewhere, is supposed to show one of two pairs of value. In one case, it should be "New" and "Assumed", and in the other "Existing" and "Organic Growth"
So currently I'm creating it with all of them, like so:
<tr>
<td nowrap align="left" valign="top">
<font color="<%=Session("TextColor")%>" style="font: 8pt arial">Subcategory: </font>
</td>
<td nowrap align="left" valign="top">
<select name="subcategory" color="<%=Session("TextColor")%>" style="font: 8pt arial" onchange="UpdateFlag=true;">
<option value="3">Organic Growth
<option value="2">Existing
<option value="1">Assumed
<option value="0">New
</select>
</td>
</tr>
But I want to only show two of these values at a time, based on the value of IsNewBusiness:
Dim IsNewBusiness As Boolean
...after this:
currentYear = Year(Now)
SQLString = "Select NewBiz from MasterUnitsprojSales where CYear = " & currentYear & " and Unit = '" & Unit & "'"
adoRS.Open(SQLString, adoCon)
IsNewBusiness = TRUE 'default (if record not found)
If Not adoRS.EOF Then
IsNewBusiness = adoRS.Fields.Item(0).Value <> 0
End If
adoRS.Close()
Knowing the value of IsNewBusiness, how can I specify which pair of items in the html select are visible? Can I add some "inline" javascript or something?