How to use a FORM element within an ASP code fragment?

  • Thread starter Thread starter sk_worldwide
  • Start date Start date
S

sk_worldwide

Guest
So i have this ASP page which displays values from an Access database. One of the fields is "Invoiced" which is stored in the database as a "Yes" or "No". On the ASP page is a drop down box next to each record. Now, if the database has a "Yes" then index 0 from the drop down box should be selected else index 1 ("No") should be selected automatically when the ASP runs.

Here is the code...

<%
Do While Not rs.EOF
userName =rs.Fields("userName").value
invoiced = rs.Fields("invoiced").value

if(StrComp(invoiced,"Yes",0) = 0) then
invoice.selectedIndex = 0 //This is the bit that I dont know how to do. How do I select the required index from the FORM FIELD "invoice" from within this ASP code?
else
invoice.selectedIndex = 1
end if

%>


Thanks guys!
 
Back
Top