Thursday, 15 July 2010

javascript - jQuery Form Errors -


I have a simple form that is not functional, it's only for a prototype, here's HTML:

  & lt; Form class = "signup" & gt; & Lt; Div class = "group" & gt; & Lt; Div class = "row" & gt; & Lt; Label & gt; Username & lt; / Labels & gt; & Lt; Input type = "text" & gt; & Lt; / Div & gt; & Lt; Div class = "row" & gt; & Lt; Label & gt; Password & lt; / Labels & gt; & Lt; Input type = "password" & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; Input type = "submit" value = "sign in" & gt; & Lt; / Form & gt;   

I think this should be because if a user inputs some data (dummy data) in user data and passwords and clicks on Submit, it will show a JavaScript alert in which " Logged in "and if there is no data in any input, then this is showing" JavaScript "warning to me.

I want to use jQuery and it is far away from me:

  $ ('signup'). Submit (function () (if ($ (this) .valid ()) {warning ('login');} else {alert ('error!');}});   

Why is there no reason not working?

It seems that you are trying to use to make sure that you use that page as your page Also, because is not a valid () function that is included with jQuery.

No comments:

Post a Comment