![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 381 Pomógł: 12 Dołączył: 9.07.2007 Ostrzeżenie: (0%) ![]() ![]() |
Witam,
od razu zacznę że nie mam kompletnego pojęcia o AJAX'ie (IMG:style_emoticons/default/sad.gif) A szukam jak sprawdzić nie wysyłając formularza czy podany e-mail istnieje w bazie, chciałbym aby przy kliknięciu w <input type="submit" /> wyskoczył alert js. Jak coś takiego najprościej uzyskać ? |
|
|
![]() |
![]()
Post
#2
|
|
Grupa: Zarejestrowani Postów: 381 Pomógł: 12 Dołączył: 9.07.2007 Ostrzeżenie: (0%) ![]() ![]() |
Doszedłem do tego (IMG:style_emoticons/default/smile.gif) Ale teraz mam problem, otórz cały czas wyskakuje mi info że podany email istnieje ... oto mój kod:
Kod <script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js'></script> <script type='text/javascript'> var CheckEmail; function check(form){ var message =""; if(form.email.value == ""){ message +="Proszę wpisać adres e-mail !\n"; } if(message != ""){ alert(message); return false; } if(!CheckEmail){ alert('Podany adres e-mail już istnieje w naszej bazie !'); return false; } } $(function(){ $("#email").change(function(){ var email = $("#email").val(); if(email.length > 3){ $.ajax({ type: "POST", url: "email.php", data: "check_email="+ email, success: function(server_response){ $("#status").ajaxComplete(function(event, request){ if(server_response == '0'){ CheckEmail = true; } else if(server_response == '1'){ CheckEmail = false; } }); } }); } else { CheckEmail = false; } return false; }) }); </script> Gdzie są błędy (IMG:style_emoticons/default/questionmark.gif) |
|
|
![]() ![]() |
![]() |
Aktualny czas: 12.10.2025 - 19:18 |