Uncheck a Checkbox

Posted on 2011-09-27
Last Modified: 2012-05-12
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

Question by:meiprogram
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 36710178
In what function are you executing that code?

Author Comment

ID: 36710209
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
   btnSubmit.Enabled = True
End If

Open in new window

LVL 41

Expert Comment

ID: 36710714
--->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"?
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.


Author Comment

ID: 36710734
No -> So is your client-side validation disabled?
Yes -> And is your Checkbox Changed set to AutoPostBack="true"?
LVL 41

Accepted Solution

guru_sami earned 500 total points
ID: 36710800
And did you set the breakpoint and see if you are hitting the cbAttest.Checked = False statement?
Is UpdatePanel involved in this process?

Author Comment

ID: 36710815
Yes I set the break-point and it is hitting the code.

No it is not in an update panel.

Author Comment

ID: 36710841
I just put it in an update-panel and it works Thanks.

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

627 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question