asp classic - ASP select option, if else syntax -
how add attribute use if else statement in asp? have list shown below.
<select> <option value="100">$100</option> <option value="200">$200</option> <option value="300">$300</option> </select>
how can write way using asp,
if (num = 100){ add attr selected="selected" <option value="100"> //read <option value="100" selected="selected"$100</option> }if (num = 200){ add attr selected="selected" <option value="200"> //read <option value="200" selected="selected"$200</option> }else{ add attr selected="selected" <option value="300"> //read <option value="300" selected="selected"$300</option> }
i don't know asp syntax, know php!
thanks
in classic asp like:
<% dim num num = 200 %> <select> <option value="100" <% if num = 100 response.write "selected='selected'" %>>$100</option> <option value="200" <% if num = 200 response.write "selected='selected'" %>>$200</option> <option value="300" <% if num <> 100 , num <> 200 response.write "selected='selected'" %>>$300</option> </select>
Comments
Post a Comment