Commit 9d379549 by Luciano Barletta

added all

1 parent da1847bc
* .vscode
!.gitignore
!*.py
!*.md
function removeField(b){
let div = b.parentElement;
let tab = div.parentElement;
tab.removeChild(div);
}
function addField(b){
let newfield = document.createElement("div")
newfield.innerHTML = document.getElementById("fieldTemplate").innerHTML;
b.parentElement.appendChild(newfield);
}
function removeTab(b){
let div = b.parentElement;
let tab = div.parentElement;
tab.removeChild(div);
}
function addTab(t){
let newtab = document.createElement("div")
newtab.innerHTML = document.getElementById("tabTemplate").innerHTML;
t.appendChild(newtab);
}
\ No newline at end of file \ No newline at end of file
<html lang="en">
<head>
<script src="{{ url_for('static', filename='Scripts/construct.js') }}"></script>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Generador de Formularios</title>
</head>
<body>
Tabs: <br>
<div id = "tabs"></div>
<button onclick="addTab(document.getElementById('tabs'))">
+
</button>
</body>
<!-- templates -->
<template id = "tabTemplate">
<br>
-------------------
<br>
<button onclick="addField(this)">
+
</button>
<br>
-------------------
<br>
</template>
<template id = "fieldTemplate">
<input type="text" placeholder="Título">
<select name="input">
<option disabled selected value="">Input</option>
<option value="text">Texto</option>
<option value="number">Numero</option>
<option value="mail">Mail</option>
<option value="password">Contraseña</option>
<option value="date">Fecha</option>
<option value="time">Hora</option>
<option value="textarea">Párrafo</option>
<option value="checkbox">Selección</option>
</select>
Obligatorio : <input type="checkbox">
<button onclick="removeField(this)">
-
</button>
</template>
</html>
\ No newline at end of file \ No newline at end of file
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!