0
I have the following function:
<script type='text/javascript'>
$(document).ready(function(){
$("input[name='numeroRg']").blur(function(){
var $nomePaciente = $("input[name='nomePaciente']");
var $dataNascPaciente = $("input[name='dataNascPaciente']");
.....
At the moment, it is being fired when the input
named after numeroRG
loses the focus
, i would like it to be fired when the user clicks on button pesquisarName
<form>
<div class="tab-content">
<div role="tabpanel" class="tab-pane fade in active" id="htab1">
<div class="row" style="padding-top: 15px;">
<div class="col-xs-4">
<div class="form-group">
<label for="numeroRg">RG:</label>
<input type="text" class="form-control" name="numeroRg" id="rg" placeholder="__.___.___-_">
</div>
<button class="btn btn-info" name="pesquisarName" id="pesquisarId">Pesquisar</button>
</div>
</div>
</div>
</form>
I’ve tried to put it this way, but it didn’t work:
<script type='text/javascript'>
$(document).ready(function(){
$("button[name='pesquisarName']").click(function(){
var $nomePaciente = $("input[name='nomePaciente']");
var $dataNascPaciente = $("input[name='dataNascPaciente']");
.....