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
Stevie Nicks Maru Kim
7,120 PointsHelp Email validation plugin - challenge 3/4
I'm stuck on the second step of the Simple Email Validation Plugin code challenge in the jQuery Plugins module: http://teamtreehouse.com/library/simple-email-validation-plugin
The challenge says: On the next line select the "textarea" call "validEmail" and pass in the parameters of "on" set to "keyup", and "success" and "failure" set to empty anonymous functions.
I followed the codes from the video
var isValid = $("input").validEmail();
function containsBlanks(){
var blanks = $required.map(function(){ return $(this).val() == ""});
return $.inArray(true, blanks) != -1;
}
function requiredFilledIn() {
if(containsBlanks() || !$("#email").validEmail())
$submit.attr("disabled","disabled");
}
$isValid.validEmail({on:"keyup", success:function(){
$(this).next().addClass("valid");
}, failure:function(){
$(this).next().removeClass("valid");
}});
requiredFilledIn();
Error message: Bummer! You didn't call 'validEmail' on the selected textarea
Help please
5 Answers
Andrew Chalkley
Treehouse Guest TeacherHi there,
I can't see where $isValid is declared? Try selecting $("textarea") and calling validEmail on that?
Regards Andrew
Stevie Nicks Maru Kim
7,120 Pointsthanks a lot Andrew, passed the challenge :)
Adam Soucie
Courses Plus Student 8,710 PointsI recently decided to go back and refresh myself on this course, and I keep running into this same error message ("You didn't call 'validEmail' on the selected text area"). What am I doing wrong?
<script>
var isValid = $("input").validEmail();
$("textarea").validEmail(
{
on: keyup,
success: function(){},
failure: function(){}
});
</script>
Andrew Chalkley
Treehouse Guest TeacherI think the issue is keyup needs to be a string. It's undefined. So it's failing to interpret the validEmail method on the "textarea".
Adam Soucie
Courses Plus Student 8,710 PointsIt's never the big mistakes that trip you up, is it? Can't believe I missed that.
Thanks, Andrew!