$(document).ready(function() { $('#sf_guard_user_username').blur(function() { if($('#sf_guard_user_username').val().length == 0) { $('#sf_guard_user_username').css('background-color', 'orange'); $('#rejestracja1').html('Login musi zawierać minimum 5. znaków.'); } } });
Czyli, że po wyjściu z inputa jak nic w nim nie wpisano to wyświetla błąd, a jak zrobić żeby było: jeśli nastąpiło wyjście z inputa '#sf_guard_user_username' LUB naciśnięto button '#register':
bo tak nie działa:
if($('#sf_guard_user_username').blur || $('#register').click)(function()
Czy zostaje tylko skopiowanie powyższego kodu i zamiana $('#sf_guard_user_username').blur(function() na $('#register').click(function()
