D
djjohnst
I am trying to fill out a form from a record set and have a few menu
boxes that have a static list of values. I want to fill out the
default value with the variable from the recordset. The one solution i
thought of is as follows:
<td colspan="3"><select name="WorkshopType"
id="WorkshopType">
<% if WorkshopType = "Information Session" then
%>
<option value="Information Session" selected>Information Session</
option>
<option value="Interview Practice Clinic">Interview
Practice Clinic</option>
<option value="Senior Job Search Seminar">Senior Job
Search Seminar</option>
<% elseif WorkshopType = "Interview Practice Clinic" then
%>
<option value="Information Session">Information Session</option>
<option value="Interview Practice Clinic"
selected>Interview Practice Clinic</option>
<option value="Senior Job Search Seminar">Senior Job
Search Seminar</option>
<% elseif WorkshopType = "Senior Job Search Seminar" then
%>
<option value="Information Session">Information Session</option>
<option value="Interview Practice Clinic">Interview
Practice Clinic</option>
<option value="Senior Job Search Seminar"
selected>Senior Job Search Seminar</option>
<%end if%>
</select>
This works great. However, this menu only had 3 options so it was easy
to implement. I also have menus with 31 different options. The way i
came up with was to do something like this:
<select name="WorkshopMonth" id="WorkshopMonth">
<option Value = "<%response.Write(WorkshopMonth)%>" selected><
%response.Write(WorkshopMonth)%></option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
</select>
Yes, this works, but it lists the default value twice. This isn't the
end of the world but I would like to clean it up a bit. Is there a
better way to do this?
boxes that have a static list of values. I want to fill out the
default value with the variable from the recordset. The one solution i
thought of is as follows:
<td colspan="3"><select name="WorkshopType"
id="WorkshopType">
<% if WorkshopType = "Information Session" then
%>
<option value="Information Session" selected>Information Session</
option>
<option value="Interview Practice Clinic">Interview
Practice Clinic</option>
<option value="Senior Job Search Seminar">Senior Job
Search Seminar</option>
<% elseif WorkshopType = "Interview Practice Clinic" then
%>
<option value="Information Session">Information Session</option>
<option value="Interview Practice Clinic"
selected>Interview Practice Clinic</option>
<option value="Senior Job Search Seminar">Senior Job
Search Seminar</option>
<% elseif WorkshopType = "Senior Job Search Seminar" then
%>
<option value="Information Session">Information Session</option>
<option value="Interview Practice Clinic">Interview
Practice Clinic</option>
<option value="Senior Job Search Seminar"
selected>Senior Job Search Seminar</option>
<%end if%>
</select>
This works great. However, this menu only had 3 options so it was easy
to implement. I also have menus with 31 different options. The way i
came up with was to do something like this:
<select name="WorkshopMonth" id="WorkshopMonth">
<option Value = "<%response.Write(WorkshopMonth)%>" selected><
%response.Write(WorkshopMonth)%></option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
</select>
Yes, this works, but it lists the default value twice. This isn't the
end of the world but I would like to clean it up a bit. Is there a
better way to do this?