Verifying radio buttons in webform

  • Thread starter Thread starter sheel331
  • Start date Start date
S

sheel331

Hello,

I have a webform that has a series of text fields and some radio
buttons, all of which are required fields. I need to be able to verify
the radio buttons in the .aspx.vb file. These radio buttons are the
answers to yes/no questions in the form. I have the syntax of
verifying a if a text field is empty, and if it is, it will throw an
alert message, and will not send the form until all fields are filled
out. Does someone know how to do this? Here is the code I have for
verifying if a text field is empty:

If (aName.Text.Trim() = String.Empty) Then

javascriptMsg = "Please provide a CollegeName"
If Not
ClientScript.IsClientScriptBlockRegistered("alert1") Then
ClientScript.RegisterStartupScript(GetType(Page),
"alert1", "<script language=JavaScript>alert('" + javascriptMsg +
"');false;</script>")
aName.Focus()
End If
End If

Any help would be greatly appreciated.

Thanks,
Sheel Shah
 
Back
Top