0
I need the ajax to take the amount typed in input and show this value in a div without clicking a button, I’m using Ajax for this, but it’s not working. What I could do to solve?
Meu Ajax
$(document).ready(function(){
$('input#valor').on('change',function () {
var valor = $(this).val();
$.ajax({
type: "POST",
url: "SaveDecision.php",
data: {valor: valor },
success: function(msg) {
$('#autosavenotify').text(msg);
}
})
});
});
Html to digital and receive value in div.
<input value="" type="text" class="form-control" name="valor" id="valor" placeholder="valor">
<div id="autosavenotify"></div>
I tried it but it didn’t work either
$(document).ready(function(){
$('input#valor').on('keypress',function () {
var valor = $(this).val();
$.ajax({
type: "POST",
url: "SaveDecision.php",
data: {valor: valor },
success: function(msg) {
$('#autosavenotify').text(msg);
}
})
});
});
$('input#valor').on('keypress',function () {
– Augusto Vasques