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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

optimize the select object

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi,
I'm dynamically building my dropdown (<select option>) with the code something like this:
<select name=&quot;1stSelect&quot;><option value=&quot;&quot; selected></option>
<script language=&quot;javascript&quot;>
<% using some java, I loop and populate the description and aName%>
var description= &quot;<%=description%>&quot;;
var s = &quot;<%=aName%>&quot;;
document.write(&quot;<option value='&quot; + description + &quot;&&&quot;+ s+&quot;'>&quot; + description);
<%} %>
</script>
</select>

The problem is I'm using the exact code to populate another select with the same items in the dropdown....

Since I'm looping through a lot of data, I'm wondering, is there a way to build these two selects inside one loop using the above code, to boost the performance?

Thanks a lot.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top