0
I have the following code that I would like to pass the ID txtCodEmpreendedor and txtName of the fields below as parameter for the event Preening();
<script>
function AdicionarEmpreendedor(codigo, item) {
//código
}
</script>
<div class="col-sm-2">
<label style="color:cornflowerblue">ID</label>
</div>
<div class="col-sm-2">
<input type="text" id="txtCodEmpreendedor" class="form-control" placeholder="Código" style="margin-left: -42px; width:92px;">
</div>
<input type="text" id="txtNomeEmpreendedor" class="form-control" placeholder="Nome Empreendedor" style="margin-left: -42px; width:273px;" />
</div>
</div>
<div class="modal-footer" style="margin-top: 165px" id="divBotao">
<button type="button" id="button" class="btn btn-secondary" data-dismiss="modal" onclick="AdicionarEmpreendedor();">Confirmar</button>
</div>
Do you want to pass these ids dynamically, and they can change? Or is it something fixed?
– David Alves
any special reason? would not be more practical in Function take the values of the fields?
– Ricardo Pontual
@Davidalves will be dynamic
– Igor Carreiro
@Ricardopunctual No, because I will store the information typed in localStorage in the browser and regastar in another view.
– Igor Carreiro