Hi there,
I have an ASP page which allows users to cancel registrations. At the moment, users are expected to search for a registration and for each result returned, a checkbox is returned with each of the results which has the value of "Yes" associated with it.
If the user checks the box and submits the form, it is assumed that they want to cancel the registration - which works fine.
If they want to reinstate the cancelled registration, then I want them to uncheck the box and submit the form so that the page can process the request.
The code snippet below shows the thought processes:
I have put it in a loop as there is no way of knowing the number of records that would be returned by the search performed by the user.
Now, the problem that I am getting - and have just read about in the google groups, is that empty check boxes are not posted when the form is submitted.
I have been working on this for some time now, and really need some assistance!
Any help, pointers, references would be much appreciated!
SonD
I have an ASP page which allows users to cancel registrations. At the moment, users are expected to search for a registration and for each result returned, a checkbox is returned with each of the results which has the value of "Yes" associated with it.
If the user checks the box and submits the form, it is assumed that they want to cancel the registration - which works fine.
If they want to reinstate the cancelled registration, then I want them to uncheck the box and submit the form so that the page can process the request.
The code snippet below shows the thought processes:
Code:
if Request.Form("txtUpdate")="XXX" then
call OpenDatabase
call CreateCommand
dim Item, intIsCancelled
for each item in Request.Form
if left(item, 3)="chk" then
dim strThisReferenceNumber, strSQL2
strThisReferenceNumber=Mid(Item, 4, 7)
if Request.Form(Item)="Yes" then
intIsCancelled=1
else
intIsCancelled=0
end if
strSQL2="Update tblDelegates SET IsCancelled=" & intIsCancelled & " WHERE ReferenceNumber='" & strThisReferenceNumber & "'"
objCmdTemp.CommandText=strSQL2
objCmdTemp.Execute
end if
next
call CloseDatabase
end if
I have put it in a loop as there is no way of knowing the number of records that would be returned by the search performed by the user.
Now, the problem that I am getting - and have just read about in the google groups, is that empty check boxes are not posted when the form is submitted.
I have been working on this for some time now, and really need some assistance!
Any help, pointers, references would be much appreciated!
SonD