Skip to main content
adicionou 2 caracteres ao conteúdo; tags editadas
Fonte Link
Sergio
  • 135,1mil
  • 16
  • 201
  • 294

$(document).on('click','#submit',function(){
    console.log($('#prescricao[qtd][1]').val());
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<input type="text" name="prescricao" id="prescricao[qtd][1]" class="form-control input-md prescricao" autocomplete="off" placeholder="" tabindex="2"/>

<button name="Cadastrar" class="btn btn-success" id="submit">Cadastrar</button>

$(document).on('click','#submit',function(){
console.log($('#prescricao[qtd][1]').val());
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<input type="text" name="prescricao" id="prescricao[qtd][1]" class="form-control input-md prescricao" autocomplete="off" placeholder="" tabindex="2"/>

<button name="Cadastrar" class="btn btn-success" id="submit">Cadastrar</button>

$(document).on('click','#submit',function(){
    console.log($('#prescricao[qtd][1]').val());
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<input type="text" name="prescricao" id="prescricao[qtd][1]" class="form-control input-md prescricao" autocomplete="off" placeholder="" tabindex="2"/>

<button name="Cadastrar" class="btn btn-success" id="submit">Cadastrar</button>

Fonte Link
George
  • 337
  • 3
  • 21

JQuery não pega valor do input

$(document).on('click','#submit',function(){
console.log($('#prescricao[qtd][1]').val());
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<input type="text" name="prescricao" id="prescricao[qtd][1]" class="form-control input-md prescricao" autocomplete="off" placeholder="" tabindex="2"/>

<button name="Cadastrar" class="btn btn-success" id="submit">Cadastrar</button>