-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathesquelas.html
94 lines (78 loc) · 3.63 KB
/
esquelas.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
83
84
85
86
87
88
89
90
91
92
93
94
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="css/styles.css" rel="stylesheet"/>
<link rel="icon" type="image/x-icon" href="images/favicon.ico">
<title>Generador UCOM</title>
</head>
<body class="indexbg">
<button class="home" id="home"><center><img src="images/home-svgrepo-com.svg" alt="home" style="width: 100%;"></center></button>
<div class="container">
<div class="box form-box">
<form id="form">
<center>
<header>Esquelas</header>
<label id="Remitente">Remitente:</label>
<br>
<select name="remitente" id="remitente">
<option selected disabled hidden>Selecciona uno</option>
<option value="remitente1">Canciller Alexandra Hill Tinoco</option>
<option value="remitente2">Viceministra Adriana Mira</option>
<option value="remitente3">Viceministra Cindy Mariella Portal</option>
<option value="remitente4">Otro</option>
</select>
<div class="field input">
<label id="Texto1">Texto 1:</label>
<textarea id="texto1" rows="4" cols="50"></textarea>
</div>
<div class="field input">
<label id="Nombre">Nombre:</label>
<textarea id="nombre" type="text" style="height: 80px;"></textarea>
</div>
<div class="field input">
<label id="Texto2">Texto 2:</label>
<textarea id="texto2" rows="4" cols="50" ></textarea>
</div>
<div class="field input">
<label id="Fechaesquela">Fecha:</label>
<input id="fechaesquela" type="text" value="Antiguo Cuscatlán,">
<div>
<button class="btn" id="esquelapost" type="submit" value="one">Crear esquela</button>
</div>
</center>
</form>
</div>
</div>
<script>
const form = document.getElementById('form');
const texto1 = document.getElementById('texto1');
const nombre = document.getElementById('nombre');
const texto2 = document.getElementById('texto2');
const fechaesquela = document.getElementById('fechaesquela');
form.addEventListener('submit', function(e){
e.preventDefault();
const texto1Value = texto1.value;
const texto2Value = texto2.value;
const nombreValue = nombre.value;
const fechaesquelaValue = fechaesquela.value;
var dropdown = document.getElementById("remitente");
var remitenteValue = dropdown.options[dropdown.selectedIndex].value;
localStorage.setItem('remitente', remitenteValue);
localStorage.setItem('texto1', texto1Value);
localStorage.setItem('texto2', texto2Value);
localStorage.setItem('nombre', nombreValue);
localStorage.setItem('fechaesquela', fechaesquelaValue);
});
let btns = document.querySelectorAll("submit");
document.getElementById('esquelapost').onclick = function() {
form.submit();
window.location.href="formato esquela.html";
}
document.getElementById('home').onclick = function() {
window.location.href="index.html";
}
</script>
</body>
</html>