Created
April 7, 2016 07:13
-
-
Save xkrsz/404d85417a963115ecdf91c482eeef77 to your computer and use it in GitHub Desktop.
z3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready -> | |
nf = $('#n') | |
snf = $('#sn') | |
pwf = $('#pw') | |
cpwf = $('#cpw') | |
$('#pw').keyup -> | |
$('#pc').text pwf.val().length | |
if pwf.val().length < 6 | |
pwf.css 'background-color', 'red' | |
else | |
pwf.css 'background-color', 'green' | |
$('#cpw').keyup -> | |
$('#cpc').text cpwf.val().length | |
if cpwf.val().length < 6 | |
cpwf.css 'background-color', 'red' | |
else | |
cpwf.css 'background-color', 'green' | |
$('#submit').on 'click', -> | |
n = nf.val() | |
sn = snf.val() | |
pw = pwf.val() | |
cpw = cpwf.val() | |
if !n || !sn || !pw || !cpw | |
alert 'Niektóre pola są puste.' | |
else if pw.length < 6 | |
alert 'Podane hasło jest za krótkie.' | |
else if pw != cpw | |
alert 'Hasła nie są takie same.' | |
else | |
alert 'Git.' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment