DONT ADD ANYTHING HERE!

  1. A radio button, allows a single value to be selected out of multiple choices with the same name value
  2. input elements of type radio are generally used in radio groups—collections of radio buttons describing a set of related options
  3. Only one radio button in a given group can be selected at the same time
  4. Radio buttons are typically rendered as small circles, which are filled or highlighted when selected
  5. A radio group is defined by giving each of radio buttons in the group the same name
  6. You can have as many radio groups on a page as you like, as long as each has its own unique name
  7. checked
    A Boolean attribute which, if present, indicates that this radio button is the default selected one in the group
  8. value
    1. The value attribute is one which all input elements share
    2. However, it serves a special purpose for inputs of type radio
    3. When a form is submitted, only radio buttons which are currently checked are submitted to the server, and the reported value is the value of the value attribute
    4. If the value is not otherwise specified, it is the string on by default

Example

Browser

Please select your preferred contact method:
choice

HTML

code
<form id="form_one">
    <fieldset>
        <legend>Please select your preferred contact method:</legend>
        <div>
            <input 
               type="radio" 
               id="contactChoice1" 
               name="param2" 
               value="email" checked />
            <label for="contactChoice1">Email</label>

            <input 
                type="radio" 
                id="contactChoice2" 
                name="param2" 
                value="phone" />
            <label for="contactChoice2">Phone</label>

            <input 
                type="radio" 
                id="contactChoice3" 
                name="param2" 
                value="mail" />
            <label for="contactChoice3">Mail</label>

        </div>
        <div>
            <button type="submit">Submit</button>
        </div>

    </fieldset>

    <fieldset>
        <legend>choice</legend>
        <output id="out-choice"></output>
    </fieldset>
    
</form>

JavaScript

code
async function sendData() {

    const formData = new FormData(form_one);

    try {
        const response = await fetch("https://php.tomgdow.com", {
            method: "POST",
            body: formData
        });

        let result = await response.text();
        console.log(result);
        let responseArray = result.split('&');
        document.getElementById('out-choice').value = responseArray[1];

    } catch (e) {
        console.error(e);
    }
}

document.getElementById('form_one').addEventListener('submit', function (event) {

    event.preventDefault();

    sendData();

}); 

References