Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding Item to select box

Status
Not open for further replies.

JackD4ME

Programmer
Jun 4, 2002
228
US
I have a select box that I am trying to clear and then repopulate. It is dynamic built on a recordset. I have tested the records and got alert boxes to popup with the correct data. I have searched the internet now for hours and cannot find anything that tells me how to repopulate the select box. It is a dependent box. The code is below...

function ezn(){
<%sTr="Select * From [District Abatements]"
set da=ezConn.Execute(sTr)
while da.eof=False%>

if (document.add_ez.ez.value=='<%=da("EZ ID")%>'){
//this is the line that i am having trouble with....
document.add_ez.ed.options[1]=new option ('<%=da("District Code")%>','<%=da("District Code")%>')
}
<%da.movenext
wend%>

}

Thanks for the help,
Jack :D
 
See my FAQ, "How do I create multi-level select / list / drop down boxes?" (faq216-6294) for a good example of this. It's been there since May, so I'm guessing you didn't check the FAQ section...

Hope this helps,
Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
That's a classic unwarranted mix of client-side and server-side functionality which is not going to work like that.
 
I know its non-conventional, but that does not mean it will not work. With this code I can already get the javascript to loop through the asp recordset and display the results in an alert box. All that needs to be done is clear the second box and populate it with the results. The problem is not with finding the correct fields, its populating the box.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top