-
Notifications
You must be signed in to change notification settings - Fork 0
/
registroc.html
82 lines (66 loc) · 3.15 KB
/
registroc.html
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
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Registro Cliente</title>
<link rel="stylesheet" href="css/estiloregistroc.css">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/css/toastr.min.css" rel="stylesheet" />
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/3.2.1/css/font-awesome.min.css" rel="stylesheet" />
</head>
<body>
<form id="form_data" method="POST">
<div class="form">
<h1>Registro de Cliente</h1>
<div class="grupo">
<input type="text" name="name" id="name" minlength="5" required><span class="barra"></span>
<label for="">Nombre Cliente</label>
</div>
<div class="grupo">
<input id="rut" name="rut" type="number" required><span class="barra"></span>
<label for="">RUT</label>
</div>
<div class="grupo">
<input type="email" name="email" id="email" required><span class="barra"></span>
<label for="">Email</label>
</div>
<div class="grupo">
<input type="password" name="password" id="password" required><span class="barra"></span>
<label for="">Contraseña</label>
</div>
<div style="text-align: center">
<button type="button" id="login" class="btn btn-primary mb-2">Registrar</button>
</div>
</div>
</form>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.19.0/jquery.validate.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js" integrity="sha384-B4gt1jrGC7Jh4AgTPSdUtOBvfO8shuf57BaghqFfPlYxofvL8/KUEfYiJOMMV+rV" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/js/toastr.min.js"></script>
<script>
$(document).ready(function() {
$("#form_data").validate();
// process the form
$('#login').on('click',function(event) {
console.log('form')
if ($("#form_data").valid()){
$.ajax({
url: 'regcliente.php',
method: 'POST',
data: $("#form_data").serialize()
}).done(function(result){
console.log(result);
toastr.success('El registro se realizo correctamente')
}).fail(function(){
toastr.error('Ups... Algo falló');
})
}else{
toastr.error('Revise los campos');
}
});
})
</script>
</body>
</html>