Jump to content

Need Help. ASP Select box, selected


mkefeli

Recommended Posts

In the codes below, always July comes selected. But I want month(Year) selected. Or, for example; ay=4 then April selected. Can anyone help me? Thenks.----------<select name="ay"> <option value="1"> JAN </option> <option value="2"> FEB </option> <option value="3"> MAR </option> <option value="4"> APR </option> <option value="5"> MAY </option> <option value="6"> JUN </option> <option value="7"selected="selected"> JLY </option> <option value="8"> AUG </option> <option value="9"> SEP </option> <option value="10"> OCT</option> <option value="11"> NOW </option> <option value="12"> DEC </option></select>

Link to comment
Share on other sites

Right. So you use the date functions to figure out what the current month is, and write the selected attribute to the appropriate tag. You use response.write in ASP to write something to the browser. So each of those tags needs an if statement to check if that is the current month and write the selected attribute if it is.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...