I have a CategoriaCNH
table with the following fields CodCategoriaCNH
and Descricao
.
I have this code snippet html
:
<select name="categoriaCnh">
<option value="" disabled selected>CNH</option>
@foreach($categoriaCnh as $cat)
<option value="{{$cat->CodCategoriaCNH}}">{{$cat->Descricao}}</option>
@endforeach
</select>
In the attribute value
of option
I am setting the CodCategoriaCNH
that comes from my table CategoriaCNH
.
The question is:
Considering security ..
Is it advisable to put CodCategoriaCNH
directly into the value
attribute?
Or, ideally, the attribute value
has the value of the column Descricao
, and in back-end
do I recover CodCategoriaCNH
?