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
Irfan Ullah
6,869 PointsProblem with Code Challenge stage Form validationa manipulation checking values
Create a method called 'isValidEmail' that takes one argument that returns true when a string with an '@' symbol is passed, false if not.
var name = $("#name");
function isValidEmail(name)
{
return name.indexOf("@")!=-1
}
if(isValidEmail($(this).val()))
{
return true;
}else{return false;}
i do not know what i am doing wrong
4 Answers
Chase Lee
29,275 PointsSorry thats wrong all you need to do is take out all the code except for the function.
Hope that helps.
Chase Lee
29,275 PointsTry putting a space between != and -1.
Irfan Ullah
6,869 PointsChase James Its still giving me the error :(
Chase Lee
29,275 PointsReplace name with email.