-1
I have the following code in jquery:
$.each(data.Dados, function (i, val) {
tr += '<tr>';
tr += '<td><div class="product" style="margin-bottom:0;padding-bottom:0;"><div class="product-info" style="margin-bottom:0;padding-bottom:0;"><h3 class="product-title">' + data.Dados[i].post_title + '</h3></div></div></td>';
tr += '<td style="text-align:center;" class="price-col" data-id-cart="' + data.Dados[i].post_id + '" id="preco_' + data.Dados[i].post_id + '">' + data.Dados[i].post_valor + '</td>';
tr += '<td style="text-align:center;padding:0;" class="quantity-col"><input data-mask="00" data-mask-selectonfocus="true" style="margin:0;" onfocus="campoTexto(this, 1)" onblur="campoTexto(this, 0)" type="number" onChange="Multiplica(' + data.Dados[i].post_id + ',' + data.Dados[i].post_quantidade + ' )" class="form-control qtd_' + data.Dados[i].post_id + '" ' + data.Dados[i].disabled + ' min="1" max="' + data.Dados[i].post_quantidade + '" placeholder="0" required=""></td>';
tr += '<td style="text-align:center;" class="subtotal-col">R$<span id="sub_' + data.Dados[i].post_id + '">0.00</span></td>';
tr += '</tr>';
});
I need to clear the -(less) signal from this blessed input field, because if a customer selects -1 the values in real time will be negative, so I can’t let that -1 be typed, if selecting via arrows from the field it blocks, the more the problem is when type.
I think I might have a regular expression that I was able to remove even by typing, or else not allow the sign in the field.
property min="0" solves...
– Matheus Lopes Marques
things like this find easily in other topics, google and related....
– Michel Simões
this property min="0" when you type the minus sign appears in the input
– user60252