-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathregistrace.php
129 lines (117 loc) · 5.29 KB
/
registrace.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
<?php
require_once ("sablona/head.php");
require_once "php/recaptcha.php";
?>
<div class="container" id="registrace">
<div class="registrace_blok">
<form name="registrace_formular" id="formular" method="post" action="reg_ok.php">
<div class="hlavicka">
<h1>Registrace</h1>
</div>
<?php
if(isset($chyba))
echo $chyba;
?>
<div class="inputy">
<div class="form-group">
<input type="text" class="login form-control cele" name="login" maxlength="50" placeholder="Přihlašovací jméno *">
</div>
<div class="form-group">
<input type="password" class="heslo form-control vedle leva" name="heslo" maxlength="60" placeholder="Heslo *">
<input type="password" class="heslo_znova form-control vedle" name="heslo_znova" maxlength="60" placeholder="Heslo znova *">
</div>
<div class="form-group">
<input type="email" class="email form-control vedle leva" name="email" maxlength="50" placeholder="E-mail *">
<input type="tel" class="telefon form-control vedle" name="telefon" maxlength="16" placeholder="Telefon *">
</div>
<hr>
<div class="form-group">
<input type="text" class="jmeno form-control vedle leva" name="jmeno" maxlength="50" placeholder="Jméno *">
<input type="text" class="prijmeni form-control vedle" name="prijmeni" maxlength="50" placeholder="Příjmení *">
</div>
<div class="form-group">
<input type="text" class="ulice form-control vedle leva" name="ulice" maxlength="50" placeholder="Ulice *">
<input type="text" class="mesto form-control vedle" name="mesto" maxlength="30" placeholder="Město *">
</div>
<div class="form-group">
<input type="text" class="psc form-control vedle leva" name="psc" maxlength="5" placeholder="PSČ *">
<select name="zeme" class="upravit_pole">
<option value="Česká republika">Česká republika</option>
<option value="Slovenská republika">Slovenská republika</option>
</select>
</div>
<div class="g-recaptcha captcha" data-sitekey="6LfRXxYTAAAAAPXgCErqkzUUtxBS3y9lmcIQA6Ox"></div>
<a href="javascript: window.history.back()" class="btn"><i class="fa fa-arrow-left"></i> Zpět</a>
<button name="registrovat" class="registrovat btn" type="submit" disabled="disabled">Registrovat</button>
</div>
</form>
</div>
</div>
<script class="cssdeck" src="//cdnjs.cloudflare.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>
<script src='https://www.google.com/recaptcha/api.js?hl=cs'></script>
<script>
$(function(){
$("input").each(function(){
$(this).change(function(){
if($(this).val() == ""){
$(this).css("border","2px solid #ea6153");
}
else{
if($(this).hasClass("heslo")){
$(".heslo_znova").css("border","2px solid #ea6153");
$(".heslo").css("border","2px solid #2ecc71");
}
else{
if($(this).hasClass("heslo_znova")){
if($(this).val() == $(".heslo").val()){
$(this).css("border","2px solid #2ecc71");
}
else{
$(this).css("border","2px solid #ea6153");
}
}
else{
$(this).css("border","2px solid #2ecc71");
}
}
}
});
});
$('input').change(function(e) {
if ($('input').map(function(idx, elem) {
if ($(elem).val() === "") return $(elem);
}).size() > 0){
console.log("nič");
$('.registrovat').prop("disabled", true);
}
else{ //KDYŽ JE VŠE VYPLNĚNO
if($(this).hasClass("heslo_znova")){
if($(this).val() == $(".heslo").val()){
$('.registrovat').prop("disabled", false);
console.log("ok");
}
else{
console.log("niet");
$('.registrovat').prop("disabled", true);
}
}
else if($(this).hasClass("heslo")){
if($(this).val() == $(".heslo_znova").val()){
$('.registrovat').prop("disabled", false);
console.log("ok");
}
else{
console.log("niet");
$('.registrovat').prop("disabled", true);
}
}
else{
$('.registrovat').prop("disabled", false);
console.log("ok");
}
}
});
});
</script>
</body>
</html>