Good morning,
I have a select where I bring the categories in my php site, after selecting the category I needed to redeem the value field to use it in the select sub-category.
I think the best way would be in the categories onchange. But for the internet the outside I saw only examples where in this same case it was called a new php, in my case it is also in another php, but in this php this gathered several functions and I need to call one in specific.
Follow the codes:
<div class="form-group">
<label class="control-label col-sm-1">Categoria: </label>
<div class="col-sm-3">
<select name="suporte" class="form-control">
<option value="0" disabled="disabled">Escolha um Categoria</option>
<?php carregar_categorias();?>
</select>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-1">Sub-Categoria: </label>
<div class="col-sm-2">
<select name="categoria" class="form-control">
<option value="0" disabled="disabled">Escolha uma categoria primeiro</option>
<?php carregar_subcategorias("1")?>
</select>
</div>
</div>