function validate() {
    // check if input is bigger than 3
    var value = document.getElementById('name').value;
    var messagefield = document.getElementById('username-text');
    if (value.length < 3)
    {
        messagefield.innerHTML = 'Gebruikersnaam te kort, minimaal 3 karakters.';
        return false;
    }
    var value2 = document.getElementById('email').value;
    var messagefield2 = document.getElementById('email-text');
    if (value2.length < 3)
    {
        messagefield2.innerHTML = 'Email te kort, minimaal 3 karakters.';
        return false;
    }
    var response = grecaptcha.getResponse();
    var responsetext = document.getElementById('captchatext');
    if(response.length == 0)
    {
        responsetext.innerHTML = 'Recaptcha niet ingevuld.';
        return false;
    }

    return true;
    }
