function refineInputs() {
    var theName = document.querySelector("#prospect-form input[name='name']").value,
        theForm = document.querySelector("#prospect-form");
    // 1. Gets first name only if full name provided
    theName = theName.split(' ')[0];
    // 2. Capitalises name first letter only & lowercase the rest
    theName = theName.split('');
    for (i = 0; i < theName.length; i++) {
        if (i == 0) {
            theName[i] = theName[i].toUpperCase();
        } else {
            theName[i] = theName[i].toLowerCase();
        }
    }
    theName = theName.join('');
    document.querySelector("#prospect-form input[name='name']").value = theName;
    console.log('Form refined... Name: ' + theName);
    console.log('Submitted should be: ' + document.querySelector("#prospect-form input[name='name']").value);
    //theForm.submit(); // not needed as submits automatically
}

console.log('form refine inputs js file loaded but not executed');