Home > Blockchain >  how to add an open "other" field in an http radio form
how to add an open "other" field in an http radio form

Time:05-15

I want to make an open "other" field in an HTTP radio form like in the following enter image description here

And you code behind say can be this for the button

Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

    Dim sChoice As String = RadioButtonList1.SelectedItem.Value
    If sChoice = "Other" Then
        ' get the text enter
        sChoice = txtOther.Text
    End If
    Debug.Print("User choice = " & sChoice)

End Sub

So, keep it simple is often the easy approach here. If 20 things on your page are OH SO having to be customized with JavaScript and all kinds of specials markup, then your project gets in trouble real fast. 10-15 things on a page, each a few minutes of time now becomes say 10-20 minutes of time, and that translates into 100-200 minutes of development time. Then the project and efforts takes way too long to finish.

And if you can try to stick to standard controls, then as above shows, the resulting code behind becomes (and stays) rather simple.

  • Related