Dropdown runs a query to populate checkboxes - ASP
Posted on 2003-11-21
I have an ASP form that has a dynamic dropdown list. I need the user's selection in the list to populate the form's checkboxes as either being checked or unchecked.
Ie. In the admin maintenance section the admin will select from a drop down list values such as Admin, Marketing, Accounting, Finance, Sales, etc... the selection will populate checkboxes that represent their access levels, such as Full Access, Limited Access, etc..
The problem with the code that I have now is that it won't allow for a selection. It keeps submitting the first item and won't allow the user to select any other items.
<select name="Role" onClick="onChangeRole()">
sSQL = "SELECT * FROM Role"
set oRs = Server.CreateObject("ADODB.Recordset")
oRs.Open sSQL, oConn,3,3
if not ors.EOF then ' check to see if recordset empty
Do while not oRs.EOF
oneRole = ors.Fields("role")
if strRoleSelected = oneRole then
nRoleId = ors.Fields("roleID")
Response.Write "<option selected value='" & strRoleSelected & "'>" & strRoleSelected
Response.Write "<option value='" & oneRole & "'>" & oneRole
var GuiList = eval("document.forms.Role");
var strRole = GuiList.value;
document.forms.action = "ChangeRoles.asp?Role=" + strRole;