Something is preventing my submit button from functioning
<p>I posted earlier regarding a different topic and want to thank all who helped me out. I've cleaned up my code pretty well (I think) but now when I click 'submit' nothing happens. I suspect the issue is regarding sending data with ajax but there is a problem with the way I've written things to send both text and radio data. Before posting this, I did do a thorough search to see if the question may have been answered in another's post but didn't find it - probably because I'm not astute enough with javascript to relate it to my own code. Anyway, here is a sample <a href="http://jsfiddle.net/J2yWQ/78/" rel="nofollow">http://jsfiddle.net/J2yWQ/78/</a> If someone could find my issue I would really appreciate it.</p>

<pre><code>function emailWarning() {
    var check = document.getElementById("check");
    check.className = 'show';
}

function validateEmail(xem) {
    var re = /\S+@\S+\.\S+/;
    return re.test(xem);
}

function postData() {
        email = 'email'+document.getElementById('email').value;
    var tt = validateEmail(email);
    if (tt == true) {
        xmlhttp.open('POST', 'payment.php', true);
        xmlhttp.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
        xmlhttp.send(myProps.join("&amp;"));
    } else {


    emailWarning();

    }

}

    var myProps = [];

function insert() {
    try {
        if (window.XMLHttpRequest) {
            xmlhttp = new XMLHttpRequest();
        } else {
            xmlhttp = new ActiveXObject('Microsoft.XMLHTTP');
        }


        myProps = [];

        function addProp(id) {
            var input = document.getElementById(id);
            if(!input) {
               input = document.forms[0][id];   
            }
            var value = encodeURIComponent(input.value);
            myProps.push(id + "=" + value);
        }

        addProp('child_name');
        addProp('age');
        addProp('hometown');
        addProp('boy_girl');
        addProp('first_name');
        addProp('last_name');
        addProp('email');
        addProp('address1');
        addProp('address2');
        addProp('city');
        addProp('state');
        addProp('zip');
        addProp('country');

        var flagInvalid = false;
        var tempArray = document.getElementsByClassName("required");
        for (var i = 0; i &lt; tempArray.length; i++) {
            if (tempArray[i].value == "") {
                flagInvalid = true;


    break;
        }
    }

    if (flagInvalid == false) {
        postData();

    } else {

        var showValidationError = function(id) {
        var el = document.getElementById(id);
        if (el) {
            el.className = 'show';
        }
        else {
            alert('Missing element #' + id);
        }
    }

    showValidationError('log');
    for (var i = 1; i &lt; 12; i++) {
        showValidationError('log' + i);
    }
}   

    } catch (e) {
        alert('An error occured in inert: ' + e);
    }

}
</code></pre>
