[Solved] Javascript User Input [closed]


Use radio buttons

<form>
    <fieldset id="group1">
        <input type="radio" value="" name="group1">
        <input type="radio" value="" name="group1">
    </fieldset>

    <fieldset id="group2">
        <input type="radio" value="" name="group2">
        <input type="radio" value="" name="group2">
        <input type="radio" value="" name="group2">
    </fieldset>
</form>

This answer is from here Multiple radio button groups in one form

If you edit the code a bit you get (You use value1 and value2 as strings for the link)

    <form>
        <fieldset id="group1" style="float:left;">
            <input type="radio" value="" name="group1">
            <input type="radio" value="" name="group1">
        </fieldset>

        <fieldset id="group2" style="float:right;left:100px;">
            <input type="radio" value="" name="group2">
            <input type="radio" value="" name="group2">
            <input type="radio" value="" name="group2">
        </fieldset>
       <button onclick="myFunction();">Submit</button>
    </form>

<script>
function myFunction() {
value1 =document.getElementById('group1').value ;
value2 =document.getElementById('group2').value ;
}
</script>

solved Javascript User Input [closed]