Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Walter Felipe
submeta
Commits
2eac966d
Commit
2eac966d
authored
Dec 22, 2022
by
Lucas Henrique
Browse files
Adiciona hidden input para controlar os campos de avaliacao
parent
82127cad
Changes
1
Hide whitespace changes
Inline
Side-by-side
resources/views/evento/criarEvento.blade.php
View file @
2eac966d
...
@@ -478,9 +478,12 @@
...
@@ -478,9 +478,12 @@
<
td
><
button
type
=
"button"
name
=
"add"
id
=
"dynamic-ar"
class
=
"btn btn-outline-primary"
>
Adicionar
</
button
></
td
>
<
td
><
button
type
=
"button"
name
=
"add"
id
=
"dynamic-ar"
class
=
"btn btn-outline-primary"
>
Adicionar
</
button
></
td
>
</
tr
>
</
tr
>
</
table
>
</
table
>
<
div
class
=
"col-sm-12 alert alert-danger"
style
=
"display: none"
id
=
"nota_maxima_invalida"
>
<
div
class
=
"col-sm-12 alert alert-danger"
style
=
"display: none"
id
=
"nota_maxima_invalida"
>
A
soma
das
notas
máximas
não
pode
ser
maior
que
10.
A
soma
das
notas
máximas
não
pode
ser
maior
que
10.
</
div
>
</
div
>
<
input
type
=
"checkbox"
id
=
"checkB[0]"
checked
name
=
"campos[]"
value
=
"0"
hidden
>
</
div
>
</
div
>
<
div
class
=
"col-sm-12 row"
style
=
"margin-top:10px; display: none"
id
=
"displayLink"
>
<
div
class
=
"col-sm-12 row"
style
=
"margin-top:10px; display: none"
id
=
"displayLink"
>
...
@@ -579,7 +582,9 @@
...
@@ -579,7 +582,9 @@
$
(
"#dynamicAddRemove"
)
.
append
(
$
(
"#dynamicAddRemove"
)
.
append
(
'<tr><td><input type="text" name="inputField[nome]['
+
i
+
']" class="form-control nome"/></td><td><input type="text" name="inputField[descricao]['
+
i
+
']" class="form-control descricao" /></td><td><input type="number" min=1 step="1" name="inputField[nota_maxima]['
+
i
+
']" class="form-control nota_maxima" /></td><td><select name="addMoreInputFields[prioridade]['
+
i
+
']" class="form-control prioridade"><option value="" selected>-- ORDEM --</option><option value="1" class="ordem_option">1</option></select></td><td><button type="button" class="btn btn-outline-danger remove-input-field" name="removeButton['
+
i
+
']">Remover</button></td></tr>'
);
'<tr><td><input type="text" name="inputField[nome]['
+
i
+
']" class="form-control nome"/></td><td><input type="text" name="inputField[descricao]['
+
i
+
']" class="form-control descricao" /></td><td><input type="number" min=1 step="1" name="inputField[nota_maxima]['
+
i
+
']" class="form-control nota_maxima" /></td><td><select name="addMoreInputFields[prioridade]['
+
i
+
']" class="form-control prioridade"><option value="" selected>-- ORDEM --</option><option value="1" class="ordem_option">1</option></select></td><td><button type="button" class="btn btn-outline-danger remove-input-field" name="removeButton['
+
i
+
']">Remover</button></td></tr>'
);
$
(
".prioridade"
)
.
children
()
.
remove
(
".dynamic"
)
$
(
"#displayCampos"
)
.
append
(
'<input type="checkbox" id="checkB['
+
i
+
']" checked name="campos[]" value="'
+
i
+
'" hidden>'
);
$
(
".prioridade"
)
.
children
()
.
remove
(
".dynamic"
);
// Exibe opções caso estejam ocultas
// Exibe opções caso estejam ocultas
$
(
'.ordem_option'
)
.
show
();
$
(
'.ordem_option'
)
.
show
();
...
@@ -611,12 +616,16 @@
...
@@ -611,12 +616,16 @@
selectId
=
$
(
this
)
.
attr
(
'name'
)
.
replace
(
/
\
D
/
g
,
""
)
.
toString
();
selectId
=
$
(
this
)
.
attr
(
'name'
)
.
replace
(
/
\
D
/
g
,
""
)
.
toString
();
currentOption
=
currentOptions
[
selectId
];
currentOption
=
currentOptions
[
selectId
];
document
.
getElementById
(
'checkB['
+
selectId
+
']'
)
.
remove
();
$
(
'.ordem_option[value|="'
+
currentOption
+
'"]'
)
.
show
();
$
(
'.ordem_option[value|="'
+
currentOption
+
'"]'
)
.
show
();
delete
currentOptions
[
selectId
];
delete
currentOptions
[
selectId
];
$
(
'.dynamic[value|="'
+
numCampos
+
'"]'
)
.
remove
();
$
(
'.dynamic[value|="'
+
numCampos
+
'"]'
)
.
remove
();
--
numCampos
;
--
numCampos
;
});
});
$
(
"#dynamicAddRemove"
)
.
on
(
'change'
,
'.prioridade'
,
function
()
{
$
(
"#dynamicAddRemove"
)
.
on
(
'change'
,
'.prioridade'
,
function
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
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 comment