Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> livequery problem
Mefior
post 26.03.2011, 19:17:31
Post #1





Grupa: Zarejestrowani
Postów: 3
Pomógł: 0
Dołączył: 26.03.2011

Ostrzeżenie: (0%)
-----


Witam,
jestem calkowicie zielony jesli chodzio jquery i js i mam problem z walidacja formularza. Laduje go do div za pomoca funkcji load problem pojawia sie przy submit . Formularz waliduje sie ale dopiero po drugim kliknieciu. Pierwszy raz jak klikne na button nic sie nie dzieje dopiero za drugim razem nastepuje walidacja. Jak pozbyc sie tego jednego , niepotrzebnego klikniecia?

CODE
$("#myform").livequery('submit',function() {


$("#myform").validate({
debug: false,
rules: {
name: "required",
email: {
required: true,
email: true
}
},
messages: {
name: "Please let us know who you are.",
email: "A valid email will help us get in touch with you.",
},
submitHandler: function(form) {
// do other stuff for a valid form
$.post('process.php', $("#myform").serialize(), function(data) {
$('#results').html(data);
});
}
});

return false;

});



HTML:
  1. <form name="myform" id="myform" action="" method="POST">
  2. <!-- The Name form field -->
  3. <label for="name" id="name_label">Name</label>
  4. <input type="text" name="name" id="name" size="30" value=""/>
  5. <br>
  6. <!-- The Email form field -->
  7. <label for="email" id="email_label">Email</label>
  8. <input type="text" name="email" id="email" size="30" value=""/>
  9. <br>
  10. <!-- The Submit button -->
  11. <input type="submit" name="submit" value="Submit">
  12. </form>
  13. <!-- We will output the results from process.php here -->
  14. <div id="results"><div>

Prosze o pomoc

Ten post edytował Mefior 27.03.2011, 00:44:18
Go to the top of the page
+Quote Post

Posty w temacie
- Mefior   livequery problem   26.03.2011, 19:17:31
- - wookieb   Proszę wstawić BBCODE   26.03.2011, 20:15:51


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 14.08.2025 - 02:50