I'm making a little asp that will allow someone to add/delete users from groups. It displays the group in a select box at the top of the page and then a list of all users below. Each user will have a checkbox next to his/her name. When a group is selected at the top, all of the users that are in that group will have their checkbox checked. This all works fine. What I need to do is when the checkbox next to a user is clicked, a sql sp is executed that either adds or deletes that user from the group, depending on the checkbox value. My idea was to open a new window (using either vbscript or javascript) and pass in the values for the user, group, and add or delete . Execute the sp. Then close that window. My problem is that I can't seem to figure out how to determine the status of the checkbox that was clicked to know whether I will be adding or deleting the user.
When I create the checkbox, I am looping through a rs and calling the checkbox: name="checkbox<%=intCount%>". How do call the clicked checkbox to get its value?
this is my checkbox code:
<INPUT type="checkbox" name=checkbox<%=intCount%> onclick="AddDelUser '<%=rsconn("user_id"
%>','<%=strGroup%>','<%=intCount%>'">
I have this as a sub:
sub AddDelUser (user,group,count)
'user = user id
'group = group id
'count = the intCount value of the checkbox
if form1.XXXXX.value = 1 then
process = 1
else
process = 0
end if
strUrl = "user_process.asp?user=" & user & "&group=" & group & "&process=" & process
window.open strUrl,"_blank","status=no,toolbar=no,location=no,menu=no,scrollbars=no,width=1,height=1"
end sub
what do I need to put in the XXXXX? Or is there another way to do this?
thanks
mwa
When I create the checkbox, I am looping through a rs and calling the checkbox: name="checkbox<%=intCount%>". How do call the clicked checkbox to get its value?
this is my checkbox code:
<INPUT type="checkbox" name=checkbox<%=intCount%> onclick="AddDelUser '<%=rsconn("user_id"
I have this as a sub:
sub AddDelUser (user,group,count)
'user = user id
'group = group id
'count = the intCount value of the checkbox
if form1.XXXXX.value = 1 then
process = 1
else
process = 0
end if
strUrl = "user_process.asp?user=" & user & "&group=" & group & "&process=" & process
window.open strUrl,"_blank","status=no,toolbar=no,location=no,menu=no,scrollbars=no,width=1,height=1"
end sub
what do I need to put in the XXXXX? Or is there another way to do this?
thanks
mwa