Verifying radio buttons in webform

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top