| | |
dropdownlist value doesnt get selected
Please support our ASP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
ive a dynamic dropdownlist, which items are retrieved frm db. but when i select an item from the dropdownlist, the item does not stay selected instead the dropdownlist make a postback and stay as default value.
wad shd i do? is there any mtd to get d value selected?
THANK YOU VERY MUCH!
related codes below--
function chktype(){
document.gt.action = 'add_user.asp?userID='+document.gt.userID.value;
document.gt.submit();
}
<select name="type" onChange="chktype();" mandatory='true' class="text">
<%sql = "select distinct * from t_user_type order by userType"
set rs = conn.execute(sql)
do while not rs.eof%>
<option value="<%=rs("userType")%>" <%if request.Form("type") =rs("userType") then response.Write(" selected")%>><%=rs("userType")%></option>
<%rs.moveNext
loop%>
</select>
wad shd i do? is there any mtd to get d value selected?
THANK YOU VERY MUCH!
related codes below--
function chktype(){
document.gt.action = 'add_user.asp?userID='+document.gt.userID.value;
document.gt.submit();
}
<select name="type" onChange="chktype();" mandatory='true' class="text">
<%sql = "select distinct * from t_user_type order by userType"
set rs = conn.execute(sql)
do while not rs.eof%>
<option value="<%=rs("userType")%>" <%if request.Form("type") =rs("userType") then response.Write(" selected")%>><%=rs("userType")%></option>
<%rs.moveNext
loop%>
</select>
•
•
Join Date: Jun 2009
Posts: 23
Reputation:
Solved Threads: 5
hey buddy
do this and it will work
and if it wont let me know
ok
here it goes
and then set the action
it will be set
ok
try it and let me know
do this and it will work
and if it wont let me know
ok
here it goes
ASP Syntax (Toggle Plain Text)
listName.options[listName.selectedIndex].value
and then set the action
it will be set
ok
try it and let me know
![]() |
Similar Threads
- please anybody to help Dropdownlist selected index problem (ASP.NET)
- DropDownList dont send selected value to the Sub DropDown_SelectedIndexChanged (ASP.NET)
- disable dropdownlist with javascript (JavaScript / DHTML / AJAX)
- Help with dropdownlist data adding? (VB.NET)
- DataGrid: Edit mode, the index of a dropdownlist does not start at the right Value (ASP.NET)
Other Threads in the ASP Forum
- Previous Thread: Constructing an A href link in CDO
- Next Thread: Passes variable when button is clicked...HELP!
| Thread Tools | Search this Thread |
archive asp asp.net aspandmssqlserver2005 aspandmssqlserver2005connection aspconnection connection database databaseconnection dreamweaver excel fso iis msmsql mssql2005 mssqlserver2005 mssqlserver2005andasp mssqlserverandasp opentextfile record searchbox selectoption single specfic sqlserver sqlserverconnection windows7






huh?!? im using asp not asp.net.. i dun quite understand wad are u tryin 2 link me to.. haha~ would u prefer to explain more.. cheers~