Click to See Complete Forum and Search --> : Updating SELECT LIST
rathnadevil
September 4th, 2002, 07:58 AM
I have some select list in an asp page. all the select lists should display list of values from different tables. when the user clicks a button it should refresh all the select lists according to the value selected in certain lists. This means i want to execute queries on recordsets and want to reload every select list.
i am new to asp. let me know the technique to do this.
dgobrien
September 4th, 2002, 10:38 AM
To use ASP to do this, you have to make a round trip to the server every time the user clicks a list item. This could be very expensive. Depending on your target browser(s), you could do this in script with data islands and click events. You should also consider the volume of data you're dealing with: you don't want to download too much data to the browser. What exactly are you trying to do?
pmmbala
September 5th, 2002, 05:57 AM
hi
get the value in variable then
loading the values in combox that time check it the variable value and ur comob box value. if its both equal make it seleted.
see the sample code
< %
dim test
test = request.Form("CboQselect2") % >
<SELECT name=CboQselect2>
<option value=0> Select </option>
< % for i= 0 to rs.RecordCount-1
if trim(test) = trim(rs.Fields(0).Value) then
Response.Write "<OPTION value=" & rs.Fields(0).Value & " selected > " & rs.Fields(1).Value & " </option>"
else
Response.Write "<OPTION value=" & rs.Fields(0).Value & "> " & rs.Fields(1).Value & " </option>"
end if
rs.MoveNext
next % >
< /SELECT>
ThanksSelected
dgobrien
September 5th, 2002, 07:10 AM
I'm kind of baffled, but here goes...Why would you have to make the option selected--the select control should have that functionality built in. And I would strongly suggest you don't want to return to the server to do it.
pmmbala
September 5th, 2002, 09:02 AM
sorry. i thought when he submit the page that time he want to display the values what he selected in select box before submit.
may be i misunderstand the problem.sorry
Thanks.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.