I'm trying to pass a string and an int in a JS so it will return me in a modal and I get this error below, could anyone help me?
Trying to pass the values here in td to JS and he has to give me this in modal. obs: using java spring to bring these values from the bank
<td><a href='#' onclick="setaDadosModal(nome, numero)" data-toggle="modal" data-target="#con-close-modal-altera"><i class="fa fa-pencil"></i></a></td>
My modal
<div id="con-close-modal-altera" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title">Alterar Modalidade</h4>
</div>
<form name="alterarModalidade" action="alteraModalidades" method="post" role="form">
<div class="modal-body">
<div class="row">
<div class="col-md-12">
<div class="form-group">
<input required="" name="idModalidades" type="hidden" id="alteraIdModalidade" class="form-control">
<input required="true" name="nomeModalidadeTemp" type="text" id="alteraNomeModalidadeTemp" class="form-control" id="exampleInputEmail1" placeholder="Digite a modalidade a ser alterada" maxlength="30">
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default waves-effect" data-dismiss="modal">Fechar</button>
<button type="submit" onclick="return alterarModal()" class="btn btn-warning waves-effect waves-light">Alterar</button>
</div>
</form>
</div>
</div>
</div>
My JS
function setaDadosModal(AltnomeModalidade, AltidModalidade) {
document.getElementById('alteraNomeModalidadeTemp').value = AltnomeModalidade;
document.getElementById('alteraIdModalidade').value = AltidModalidade;}
My Error
Modes: 258 Uncaught ReferenceError: yyyy is not defined at HTMLAnchorElement.onclick (modal: 258)
Line 258 that the error refers to
<td><a href='#' onclick="setaDadosModal(aaaa, 107)" data-toggle="modal" data-target="#con-close-modal-altera"><i class="fa fa-pencil"></i></a></td>