I have two checkboxes that prepopulate a radiobutton. When I select yes on the checkbox it open the radio button that's checked as true with text as a number. I would like to know how to select a single checkbox and display it as a total when I click submit button and it display my single checkbox number as a total in a label end if I select and checked both checkboxes it must add up both checkboxes radiobutton button numbers and display as a total so if single checkbox is selected display the single total end if both checkboxes is selected add up the two numbers and display total in a label when you click submit. Any help will do and be well appreciated Thanks
Heres my code:
Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim number1 As Double
Dim number2 As Double
Dim answer As Double
Dim total As Integer
number1 = Double.Parse(RadioButton1.Text)
number2 = Double.Parse(RadioButton2.Text)
If CheckBox1.Checked = True Then
answer = number1
answerLbl.Text = answer.ToString()
ElseIf CheckBox2.Checked = True Then
answer = number2
answerLbl.Text = answer.ToString()
ElseIf CheckBox1.Checked = True And CheckBox2.Checked = True Then
answerLbl.Text = total.ToString()
End If
End Sub