Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Luciano Barletta
/
mini-web
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit 9d379549
authored
2019-11-22 12:07:08 +0000
by
Luciano Barletta
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
added all
1 parent
da1847bc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
75 additions
and
4 deletions
.gitignore
static/Scripts/construct.js
templates/generate.html
.gitignore
View file @
9d37954
*
.vscode
!.gitignore
!*.py
!*.md
static/Scripts/construct.js
0 → 100644
View file @
9d37954
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
templates/generate.html
0 → 100644
View file @
9d37954
<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
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment