1. *** New version of B4J is available ***
    B4J v7.8
    Dismiss Notice

B4R Code Snippet RadioButton with ESP Server

Discussion in 'B4R Code Snippets' started by Hans- Joachim Krahe, Jul 17, 2019.

  1. Hans- Joachim Krahe

    Hans- Joachim Krahe Active Member Licensed User

    ho = start value of radiobutton

    Code:
    Select ho
                
    Case 0
                    Astream.Write(
    "<div><input Type=""radio"" id=""rb1o"" name=""ho"" value=""rb1o""checked><label For=""rb1o"">1</label>")
                    Astream.Write(
    "<input Type=""radio"" id=""rb2o"" name=""ho"" value=""rb2o""><label For=""rb2o"">2</label>")
                    Astream.Write(
    "<input Type=""radio"" id=""rb3o"" name=""ho"" value=""rb3o""><label For=""rb3o"">3</label></div><br />")
                
    Case 1
                    Astream.Write(
    "<div><input Type=""radio"" id=""rb1o"" name=""ho"" value=""rb1o""><label For=""rb1o"">1</label>")
                    Astream.Write(
    "<input Type=""radio"" id=""rb2o"" name=""ho"" value=""rb2o""checked><label For=""rb2o"">2</label>")
                    Astream.Write(
    "<input Type=""radio"" id=""rb3o"" name=""ho"" value=""rb3o""><label For=""rb3o"">3</label></div><br />")
                
    Case 2
                    Astream.Write(
    "<div><input Type=""radio"" id=""rb1o"" name=""ho"" value=""rb1o""><label For=""rb1o"">1</label>")
                    Astream.Write(
    "<input Type=""radio"" id=""rb2o"" name=""ho"" value=""rb2o""><label For=""rb2o"">2</label>")
                    Astream.Write(
    "<input Type=""radio"" id=""rb3o"" name=""ho"" value=""rb3o""checked><label For=""rb3o"">3</label></div><br />")
                    
            
    End Select

    Browser will answer: ho = (rb1o or rb2o or rb3o)

    ... may be, there will be an easier solutiuon, but at all - it works:)
     
    Last edited: Jul 17, 2019
    Johan Schoeman and Erel like this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice