![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 174 Pomógł: 3 Dołączył: 23.02.2008 Ostrzeżenie: (0%) ![]() ![]() |
Witam
Napisałem sobie taki skrypt walidujący formularz, jeśli user wpisze w pole "Adam" to formularz ma się zatwierdzić, ale się nie zatwierdza: Kod <script type="text/javascript">
$(function() { $('#submit').click(function() { var Val = $('#adam').attr('value'); if(Val != "adam" && Val != "Adam") alert('Małysz ma na imię Adam'); else { var form=document.forms[0]; form.submit(); } }); }) </script> -------------------- |
|
|
![]() |
![]()
Post
#2
|
|
![]() Grupa: Zarejestrowani Postów: 76 Pomógł: 7 Dołączył: 30.09.2006 Ostrzeżenie: (0%) ![]() ![]() |
Kod <script type="text/javascript"> $(function() { $('#form_adam').submit(function() { if ($("#imie").val() != 'Adam') { alert('Małysz to Adam'); return false; } }); }) </script> <form id="form_adam" action="?" method="post"> <input type="text" name="imie" id="imie" /> <input type="submit" /> </form> pisane z palca, sprawdź |
|
|
![]()
Post
#3
|
|
Grupa: Zarejestrowani Postów: 174 Pomógł: 3 Dołączył: 23.02.2008 Ostrzeżenie: (0%) ![]() ![]() |
Super, działa.
-------------------- |
|
|
![]() ![]() |
![]() |
Aktualny czas: 19.08.2025 - 15:47 |