I have a registration page and I have a radio button for either customer or employee. Employee has additional fields that need to be shown and should be hidden when the customer is registering.
The problem that I have is that my original code works, but it will only work when the submit button is clicked. It wont work when I click the different radio buttons. I have to first click a radio button THEN hit submit or the changes wont show. Basically, how can I have the page automatically change without having to hit the submit button?
Here is the code I have so far.
Private Sub person_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles person.SelectedIndexChanged
If person.SelectedValue.Equals("Customer") Then
Label11.Visible = False
Label12.Visible = False
Label13.Visible = False
Label14.Visible = False
txtSoc.Visible = False
txtPayRate.Visible = False
txtPayType.Visible = False
txtStartDate.Visible = False
Label3.Text = "Company"
ElseIf person.SelectedValue.Equals("Employee") Then
Label11.Visible = True
Label12.Visible = True
Label13.Visible = True
Label14.Visible = True
txtSoc.Visible = True
txtPayRate.Visible = True
txtPayType.Visible = True
txtStartDate.Visible = True
Label3.Text = "Position"
End If
End Sub
The problem that I have is that my original code works, but it will only work when the submit button is clicked. It wont work when I click the different radio buttons. I have to first click a radio button THEN hit submit or the changes wont show. Basically, how can I have the page automatically change without having to hit the submit button?
Here is the code I have so far.
Private Sub person_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles person.SelectedIndexChanged
If person.SelectedValue.Equals("Customer") Then
Label11.Visible = False
Label12.Visible = False
Label13.Visible = False
Label14.Visible = False
txtSoc.Visible = False
txtPayRate.Visible = False
txtPayType.Visible = False
txtStartDate.Visible = False
Label3.Text = "Company"
ElseIf person.SelectedValue.Equals("Employee") Then
Label11.Visible = True
Label12.Visible = True
Label13.Visible = True
Label14.Visible = True
txtSoc.Visible = True
txtPayRate.Visible = True
txtPayType.Visible = True
txtStartDate.Visible = True
Label3.Text = "Position"
End If
End Sub