jQuery Form Errors

I have an simple form that's not meant to functional, it's just for a prototype. Here's the HTML:\[code\]<form class="signup"> <div class="group"> <div class="row"> <label>Username</label> <input type="text"> </div> <div class="row"> <label>Password</label> <input type="password"> </div> </div> <input type="submit" value="http://stackoverflow.com/questions/15647000/Sign In"></form>\[/code\]I need to have it so if a user was to input some data (dummy data) into the username and password and click submit, it'll show a JavaScript alert saying "Logged in" and if one of the inputs doesn't contain any data, I'd like it to show a JavaScript alert saying "Error".I want to use jQuery and this is what I have so far:\[code\]$('.signup').submit(function () { if($(this).valid()) { alert('Logged in'); }else { alert('Error!'); }});\[/code\]Any reason why that's not working?
 
Back
Top