I have the following cludge of code (direct C&P from my page):
I need to set all my form variables for each "key" to 1 or 0 so I can insert it into a table.
The problem is that my loop only seems to register any checkboxes that are checked (ie, "on"). Those that are unchecked don't register in the loop. For example, my sample data produced the following:
while it *should* have produced the following:
The variables that are missing are those that I had unchecked.
Any idea how I can get it to return *all* the pieces of information in the form, checked or unchecked?
Code:
for each key in Request.Form
if Request(key) = "on" then
key = 1
else
key = 0
end if
next
I need to set all my form variables for each "key" to 1 or 0 so I can insert it into a table.
The problem is that my loop only seems to register any checkboxes that are checked (ie, "on"). Those that are unchecked don't register in the loop. For example, my sample data produced the following:
Code:
ClientSurveyInvite: 1
UserAdmin: 1
FinancialReporting: 1
Timesheets: 1
Sysadmin: 1
while it *should* have produced the following:
Code:
SearchWarrant: 1
FileReview: 1
OnlineRequestForms: 1
Dashboard: 1
Timesheetmgmt: 1
Timesheets: 1
ClientSurveyInvite: 1
UserAdmin: 1
FinancialReporting: 1
Sysadmin: 1
The variables that are missing are those that I had unchecked.
Any idea how I can get it to return *all* the pieces of information in the form, checked or unchecked?