Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial


Mike Capewell
Mike Capewell
4,501 Points

Website Waters 3 - Contact From Validation - containBlanks function

Hi Guys,

I'm working through the build-an-interactive-website module, and the stage: form-validation-and-manipulation.

For some reason I cannot get the following script to validate the form and enable to the submit button.

I think its the containsBlanks function but can't get to the button of it, really appreciate any help.

Thanks Mike


<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript">
var $submit = $(".submit input");
var $required = $(".required");

    function containsBlanks(){
        var blanks = new Array();
            blanks.push($(this).val() == "");
        return blanks.sort().pop();

    function isValidEmail(email){
        return email.indexOf("@") != -1;

    function requiredFilledIn (){

    $("#form span").hide();
        //Check all required fields.

        // check for valid email.

    requiredFilledIn ();


4 Answers

James Barnett
James Barnett
39,199 Points

Mike Capewell - When posting issues with a code challenge make sure to post either the instructions or a link to the code challenge so we know what your code is trying to do.

Mike Capewell
Mike Capewell
4,501 Points

Sorry, it's not a code challenge, I following the steps here:


In form validation and can't seem to recreate the code correctly so the submit button enables when all fields are filled in correctly.



Sorry to hear about the trouble you're having Mike. Is there any way you could email me directly at help@teamtreehouse.com? Mind sending a screenshot that includes your answer, Bummer! hint, and Code Challenge Task #? That would be super helpful. Thanks!

  • Elizabeth