I have created a form and I am looking to get the data the user entered. The javascript I have, so far pulls in all the data. I am having an issue with pulling the data of the selected radio button. I read some articles and they say the 'name' needs to be the sames but this doesn't work and if I give it unique 'ID's then selecting one or the other radio buttons doesn't work. Also I can't use jQuery
js
var myNodeList = document.getElementsByName('cf');
var myArray = []; // empty Array
for (var i = 0; i < myNodeList.length; i++) {
    if(i<4)
        for ( i; i < 3; i++) {
            var self = myNodeList[i].value;
            myArray.push(self);
        }
    else if(i==4)
        myArray.push(document.getElementById('status').value);
    else if(i==5)
        myArray.push(document.getElementById('subscribe').value);
    else if(i==6)
        myArray.push(document.getElementsByName('support')[i]);
    else if(i==7)
        for ( i; i < myNodeList.length; i++) {
            var self = myNodeList[i].value;
            myArray.push(self);
        }
}
console.log(myArray)
html
 <!DOCTYPE html>
<html>
<head>
  <title>Contact Me</title>
  <link rel="stylesheet" type="text/css" href="contactform_Lab8.css">
</head>
<body>
<form id="contactus">
    <fieldset>
        <label for="name">Name:</label>
            <input id="name" type="text" name="cf" autofocus required>
        <label for="email">Email:</label>
            <input id="email" type="email" name="cf" required>
        <label for="phone">Phone:</label>
            <input id="phone" type="tel" name="cf" required>
        <label for="status">Status:         
            <select id="status" name="cf" required>
                <option value="client">Client</option>
                <option value="partner">Partner</option>
                <option value="vendor">Vendor</option>
            </select>
        </label>
        <label for="subscribe">
            <input id="subscribe" type="checkbox" name="cf" value="check" checked> 
        Send me your newsletter</label>
        <label for="sales">
            <label for="support">
                <input id="sales" type="radio" name="slsSupport" value="sales" checked>Sales
                <input id="support" type="radio" name="slsSupport" value="support">Support
            </label>
        </label>
        <label for="msg">Message:</label>
            <textarea id="msg" name="cf" rows="10" cols="30" required></textarea>
        </fieldset>
        <fieldset>
        <button type="submit">Send</button>
        <button type="reset">Reset</button>
        </fieldset>
</form>
<script src="contactform_Lab8.js"></script>
</body>
</html>
 
     
     
     
    