Uncheck a Checkbox

I have a form that I am validating, if the user misses a field, I send them back to question they missed.  At this point I want to uncheck a checkbox.  But the code doesn't work.
If bValid = False AndAlso cbAttest.Checked Then
     cbAttest.Checked = False
End If

Open in new window

meiprogramAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
guru_samiConnect With a Mentor Commented:
And did you set the breakpoint and see if you are hitting the cbAttest.Checked = False statement?
Is UpdatePanel involved in this process?
0
 
käµfm³d 👽Commented:
In what function are you executing that code?
0
 
meiprogramAuthor Commented:
I was doing it in the Validate function.  That didn't work.  So I but the following in the check-box checkchanged.
If Not ValidateForm(True) Then
   cbAttest.Checked = False
Else
   btnSubmit.Enabled = True
End If

Open in new window

0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
guru_samiCommented:
--->if the user misses a field, I send them back to question they missed.
So is your client-side validation disabled?
And is your Checkbox Changed set to AutoPostBack="true"?
0
 
meiprogramAuthor Commented:
No -> So is your client-side validation disabled?
Yes -> And is your Checkbox Changed set to AutoPostBack="true"?
0
 
meiprogramAuthor Commented:
Yes I set the break-point and it is hitting the code.

No it is not in an update panel.
0
 
meiprogramAuthor Commented:
I just put it in an update-panel and it works Thanks.
0
All Courses

From novice to tech pro — start learning today.