Very new to php, but like the challenge. I have a Yes & No radio button config. I would like a dialog box to open if the "no" radio button is selected. Below is the "No"" radio button code. I have searched for quite awhile and have some examples, but can't get them to function.

 <div class="form-check">
                <div class="col-3 pr-0 text-float-right">
                    <input class="form-check-input" type="radio" name="HLdefault" id="HL_defaultno" value="hl2">
                       
<label class="form-check-label font-weight-bold text-danger" for="HL_defaultno">No</label> </div> </div>

Any help would be greatly appreciated!

    Figures I find something that solves my first problem right after I post! So now the alert opens on the "no" selection of the radio button. In that dialog box, I would like to build an "if and then" statement. Yes opens another html page, no captures the "no" value and close the dialog box.
    Here is the script I found and inserted.

    <div class="form-check">
                    <div class="col-3 pr-0 text-float-right">
                        <input class="form-check-input" type="radio" name="HLdefault" id="HL_defaultno"
                            onclick="showMessage()" value="hl2">
    
                    <label class="form-check-label font-weight-bold text-danger" for="HL_defaultno">No</label>
                </div>
                <script>
                function showMessage() {
                    // Example displaying an alert
                    alert("Would you like to create an Issue?")
                }
                </script>
            </div>
    

      You could have your function check to see if it's selected or not, and use that to determine if you do anything, e.g.:

      <!DOCTYPE html>
      <head>
        <title>test</title>
        <script>
          function check_it(element) {
            if(element.checked) {
              alert("You selected it.");
            }
          }
        </script>
      </head>
      <body>
        <form>
          <p><label><input type='checkbox' name="foo" onchange="check_it(this);"> click me</label></p>
        </form>
      </body>
      
        Write a Reply...