![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 8 Pomógł: 0 Dołączył: 28.12.2008 Ostrzeżenie: (0%) ![]() ![]() |
Witam, jestem początkująca jeśli chodzi o jave script, php i w ogóle programowanie w internecie. Ostatnio męczę się nad biblioteką jquery.validation
Mianowicie mam formularz rejestracyjny (na stronie przykład mój) www.amehobpoezja.pl i nie mam pojęcia jak zrobić ta walidacje. Działa mi ta podstawowa gdy dam:
w deklaracji strony mam: a formukarz wygląda tak:
nie mam pojęcia czemu jak wpiszę:
to już mi się nie waliduje (IMG:style_emoticons/default/sad.gif) gdzie robię błąd? no i nie wiem jak się blokuje submit puki nie będą dobrze wypełnione wszystkie pola. Proszę Was o pomoc (IMG:style_emoticons/default/sad.gif) nie śmiejcie się ze mnie ;/ ps. w googleach niby są tutki ale nie działa mi to jak powinno. gdzieś robię błąd:( pomyliłam działy i umieściłam tego posta też w dziale AJAX (proszę o usunięcie go, oraz przepraszam za kłopot) |
|
|
![]() |
![]()
Post
#2
|
|
Grupa: Zarejestrowani Postów: 603 Pomógł: 131 Dołączył: 24.07.2007 Skąd: Górny Śląsk Ostrzeżenie: (0%) ![]() ![]() |
Zobacz poniższy kod i przyjrzyj się gdzie jest rules:{}:
Kod $(document).ready(function() { // validate signup form on keyup and submit var validator = $("#signupform").validate({ rules: { firstname: "required", lastname: "required", username: { required: true, minlength: 2, remote: "users.php" }, password: { required: true, minlength: 5 }, password_confirm: { required: true, minlength: 5, equalTo: "#password" }, email: { required: true, email: true, remote: "emails.php" }, dateformat: "required", terms: "required" }, messages: { firstname: "Enter your firstname", lastname: "Enter your lastname", username: { required: "Enter a username", minlength: jQuery.format("Enter at least {0} characters"), remote: jQuery.format("{0} is already in use") }, password: { required: "Provide a password", rangelength: jQuery.format("Enter at least {0} characters") }, password_confirm: { required: "Repeat your password", minlength: jQuery.format("Enter at least {0} characters"), equalTo: "Enter the same password as above" }, email: { required: "Please enter a valid email address", minlength: "Please enter a valid email address", remote: jQuery.format("{0} is already in use") }, dateformat: "Choose your preferred dateformat", terms: " " }, // the errorPlacement has to take the table layout into account errorPlacement: function(error, element) { if ( element.is(":radio") ) error.appendTo( element.parent().next().next() ); else if ( element.is(":checkbox") ) error.appendTo ( element.next() ); else error.appendTo( element.parent().next() ); }, // specifying a submitHandler prevents the default submit, good for the demo submitHandler: function() { alert("submitted!"); }, // set this class to error-labels to indicate valid fields success: function(label) { // set as text for IE label.html(" ").addClass("checked"); } }); P.S. Błąd masz w 2. linijce. |
|
|
![]()
Post
#3
|
|
Grupa: Zarejestrowani Postów: 8 Pomógł: 0 Dołączył: 28.12.2008 Ostrzeżenie: (0%) ![]() ![]() |
no ale w dallszym ciagu nie wyświetlają mi się
"messages"
pokazują mi się te standardowe teksty a nie te które ja chce i tutaj je zadeklarowałam a podczas naciskania submite mi się to wysyła mimo że nie są wypełnione pola Ten post edytował ulotna_chwila87 28.01.2010, 21:50:55 |
|
|
![]()
Post
#4
|
|
Grupa: Zarejestrowani Postów: 603 Pomógł: 131 Dołączył: 24.07.2007 Skąd: Górny Śląsk Ostrzeżenie: (0%) ![]() ![]() |
W 20. linii masz przecinek po nawiasie klamrowym. Usuń go.
|
|
|
![]() ![]() |
![]() |
Aktualny czas: 22.08.2025 - 21:25 |