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
737ab459
Commit
737ab459
authored
Jun 15, 2020
by
alinetenorio
Browse files
setando opção inicial em select boxes
parent
7f1b00b7
Changes
2
Show whitespace changes
Inline
Side-by-side
resources/lang/pt-BR/validation.php
View file @
737ab459
...
@@ -57,12 +57,12 @@ return [
...
@@ -57,12 +57,12 @@ return [
'not_in'
=>
'O :attribute selecionado é inválido.'
,
'not_in'
=>
'O :attribute selecionado é inválido.'
,
'numeric'
=>
':Attribute deve ser um número.'
,
'numeric'
=>
':Attribute deve ser um número.'
,
'regex'
=>
'O formato de :attribute é inválido.'
,
'regex'
=>
'O formato de :attribute é inválido.'
,
'required'
=>
'O campo
:attribute
é obrigatório.'
,
'required'
=>
'O campo é obrigatório.'
,
'required_if'
=>
'O campo
:attribute
é obrigatório
quando :other é :value
.'
,
'required_if'
=>
'O campo é obrigatório.'
,
'required_unless'
=>
'O :attribute é necessário a menos que :other esteja em :values.'
,
'required_unless'
=>
'O :attribute é necessário a menos que :other esteja em :values.'
,
'required_with'
=>
'O campo
:attribute
é obrigatório
quando :values está presente
.'
,
'required_with'
=>
'O campo é obrigatório.'
,
'required_with_all'
=>
'O campo :attribute é obrigatório quando :values estão presentes.'
,
'required_with_all'
=>
'O campo :attribute é obrigatório quando :values estão presentes.'
,
'required_without'
=>
'O campo
:attribute
é obrigatório
quando :values não está presente
.'
,
'required_without'
=>
'O campo é obrigatório.'
,
'required_without_all'
=>
'O campo :attribute é obrigatório quando nenhum destes estão presentes: :values.'
,
'required_without_all'
=>
'O campo :attribute é obrigatório quando nenhum destes estão presentes: :values.'
,
'same'
=>
':Attribute e :other devem ser iguais.'
,
'same'
=>
':Attribute e :other devem ser iguais.'
,
'size'
=>
[
'size'
=>
[
...
...
resources/views/evento/submeterTrabalho.blade.php
View file @
737ab459
...
@@ -30,7 +30,7 @@
...
@@ -30,7 +30,7 @@
<
div
class
=
"row justify-content-center"
>
<
div
class
=
"row justify-content-center"
>
<
div
class
=
"col-sm-4"
>
<
div
class
=
"col-sm-4"
>
<
label
for
=
"grandeArea"
class
=
"col-form-label"
>
{{
__
(
'Grande Área*:'
)
}}
</
label
>
<
label
for
=
"grandeArea"
class
=
"col-form-label"
>
{{
__
(
'Grande Área*:'
)
}}
</
label
>
<
select
class
=
"form-control @error('grandeArea') is-invalid @enderror"
id
=
"grandeArea"
name
=
"grandeArea"
onchange
=
"areas()"
onload
=
"areas()"
>
<
select
class
=
"form-control @error('grandeArea') is-invalid @enderror"
id
=
"grandeArea"
name
=
"grandeArea"
onchange
=
"areas()"
>
<
option
value
=
""
disabled
selected
hidden
>--
Grande
Área
--</
option
>
<
option
value
=
""
disabled
selected
hidden
>--
Grande
Área
--</
option
>
@
foreach
(
$grandeAreas
as
$grandeArea
)
@
foreach
(
$grandeAreas
as
$grandeArea
)
<
option
@
if
(
old
(
'grandeArea'
)
==
$grandeArea
->
id
)
selected
@
endif
value
=
"
{
{$grandeArea->id}}">{{$grandeArea->nome}
}
</option>
<
option
@
if
(
old
(
'grandeArea'
)
==
$grandeArea
->
id
)
selected
@
endif
value
=
"
{
{$grandeArea->id}}">{{$grandeArea->nome}
}
</option>
...
@@ -45,8 +45,8 @@
...
@@ -45,8 +45,8 @@
</div>
</div>
<div class="
col
-
sm
-
4
">
<div class="
col
-
sm
-
4
">
<label for="
area
" class="
col
-
form
-
label
">{{ __('Área*:') }}</label>
<label for="
area
" class="
col
-
form
-
label
">{{ __('Área*:') }}</label>
<select class="
form
-
control
@
error
(
'area'
)
is
-
invalid
@
enderror
" id="
area
" name="
area
" onchange="
subareas
()
">
<input type="
hidden
" id="
oldArea
" value="
{{
old
(
'area'
)
}}
"></input>
<input type="
hidden
" id="
oldArea
" value="
{{
old
(
'area'
)
}}
"></input>
<select class="
form
-
control
@
error
(
'area'
)
is
-
invalid
@
enderror
" id="
area
" name="
area
" onchange="
subareas
()
">
<option value="" disabled selected hidden>-- Área --</option>
<option value="" disabled selected hidden>-- Área --</option>
{{-- @foreach(
$areas
as
$area
)
{{-- @foreach(
$areas
as
$area
)
<option @if(old('area')==
$area->id
) selected @endif value="
{{
$area
->
id
}}
">
{
{$area->nome}
}
</option>
<option @if(old('area')==
$area->id
) selected @endif value="
{{
$area
->
id
}}
">
{
{$area->nome}
}
</option>
...
@@ -61,8 +61,8 @@
...
@@ -61,8 +61,8 @@
</div>
</div>
<div class="
col
-
sm
-
4
">
<div class="
col
-
sm
-
4
">
<label for="
subArea
" class="
col
-
form
-
label
">{{ __('Sub Área*:') }}</label>
<label for="
subArea
" class="
col
-
form
-
label
">{{ __('Sub Área*:') }}</label>
<select class="
form
-
control
@
error
(
'subArea'
)
is
-
invalid
@
enderror
" id="
subArea
" name="
subArea
">
<input type="
hidden
" id="
oldSubArea
" value="
{{
old
(
'subArea'
)
}}
"></input>
<input type="
hidden
" id="
oldSubArea
" value="
{{
old
(
'subArea'
)
}}
"></input>
<select class="
form
-
control
@
error
(
'subArea'
)
is
-
invalid
@
enderror
" id="
subArea
" name="
subArea
">
<option value="" disabled selected hidden>-- Sub Área --</option>
<option value="" disabled selected hidden>-- Sub Área --</option>
{{-- @foreach(
$subAreas
as
$subArea
)
{{-- @foreach(
$subAreas
as
$subArea
)
<option @if(old('subArea')==
$subArea->id
) selected @endif value="
{{
$subArea
->
id
}}
">
{
{$subArea->nome}
}
</option>
<option @if(old('subArea')==
$subArea->id
) selected @endif value="
{{
$subArea
->
id
}}
">
{
{$subArea->nome}
}
</option>
...
@@ -583,27 +583,25 @@
...
@@ -583,27 +583,25 @@
// }
// }
function
areas
()
{
function
areas
()
{
console
.
log
(
'aqui D'
);
var
grandeArea
=
$
(
'#grandeArea'
)
.
val
();
var
grandeArea
=
$
(
'#grandeArea'
)
.
val
();
$
.
getJSON
(
"{{ config('app.url') }}/naturezas/areas/"
+
grandeArea
,
$
.
getJSON
(
"{{ config('app.url') }}/naturezas/areas/"
+
grandeArea
,
function
(
dados
)
{
function
(
dados
)
{
if
(
dados
.
length
>
0
)
{
if
(
dados
.
length
>
0
)
{
console
.
log
(
'aqui A'
);
if
(
$
(
'#oldArea'
)
.
val
()
==
null
||
$
(
'#oldArea'
)
.
val
()
==
""
){
var
option
=
'<option>-- Área --</option>'
;
var
option
=
'<option selected disabled>-- Área --</option>'
;
}
$
.
each
(
dados
,
function
(
i
,
obj
)
{
$
.
each
(
dados
,
function
(
i
,
obj
)
{
if
(
$
(
'#oldArea'
)
.
val
()
!=
null
&&
$
(
'#oldArea'
)
.
val
()
==
obj
.
id
){
if
(
$
(
'#oldArea'
)
.
val
()
!=
null
&&
$
(
'#oldArea'
)
.
val
()
==
obj
.
id
){
console
.
log
(
'aqui B'
);
option
+=
'<option selected value="'
+
obj
.
id
+
'">'
+
obj
.
nome
+
'</option>'
;
option
+=
'<option selected value="'
+
obj
.
id
+
'">'
+
obj
.
nome
+
'</option>'
;
}
else
{
}
else
{
option
+=
'<option value="'
+
obj
.
id
+
'">'
+
obj
.
nome
+
'</option>'
;
option
+=
'<option value="'
+
obj
.
id
+
'">'
+
obj
.
nome
+
'</option>'
;
}
}
})
})
}
else
{
}
else
{
console
.
log
(
'aqui C'
);
var
option
=
"<option selected disabled>-- Área --</option>"
;
var
option
=
"<option>-- Área --</option>"
;
}
}
$
(
'#area'
)
.
html
(
option
)
.
show
();
$
(
'#area'
)
.
html
(
option
)
.
show
();
//
subareas();
subareas
();
})
})
}
}
...
@@ -612,10 +610,10 @@
...
@@ -612,10 +610,10 @@
$
.
getJSON
(
"{{ config('app.url') }}/naturezas/subarea/"
+
area
,
$
.
getJSON
(
"{{ config('app.url') }}/naturezas/subarea/"
+
area
,
function
(
dados
)
{
function
(
dados
)
{
if
(
dados
.
length
>
0
)
{
if
(
dados
.
length
>
0
)
{
var
option
=
'<option>-- Sub Área --</option>'
;
if
(
$
(
'#oldSubArea'
)
.
val
()
==
null
||
$
(
'#oldSubArea'
)
.
val
()
==
""
){
var
option
=
'<option selected disabled>-- Sub Área --</option>'
;
}
$
.
each
(
dados
,
function
(
i
,
obj
)
{
$
.
each
(
dados
,
function
(
i
,
obj
)
{
console
.
log
(
$
(
'#oldSubArea'
)
.
val
());
console
.
log
(
obj
.
id
);
if
(
$
(
'#oldSubArea'
)
.
val
()
!=
null
&&
$
(
'#oldSubArea'
)
.
val
()
==
obj
.
id
){
if
(
$
(
'#oldSubArea'
)
.
val
()
!=
null
&&
$
(
'#oldSubArea'
)
.
val
()
==
obj
.
id
){
option
+=
'<option selected value="'
+
obj
.
id
+
'">'
+
obj
.
nome
+
'</option>'
;
option
+=
'<option selected value="'
+
obj
.
id
+
'">'
+
obj
.
nome
+
'</option>'
;
}
else
{
}
else
{
...
@@ -623,7 +621,7 @@
...
@@ -623,7 +621,7 @@
}
}
})
})
}
else
{
}
else
{
var
option
=
"<option>-- Sub Área --</option>"
;
var
option
=
"<option
selected disabled
>-- Sub Área --</option>"
;
}
}
$
(
'#subArea'
)
.
html
(
option
)
.
show
();
$
(
'#subArea'
)
.
html
(
option
)
.
show
();
})
})
...
...
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