Skip to main content
Topic: Max value (Read 835 times) previous topic - next topic


 

Re: Max value

Reply #2
hi, i used this,  to prevent user to add a value bigger than x_value

$( "#entregas_p-add-form" ).submit(function( event ) {
   if ( +$('#ctrl-e1').val() > +$('#ctrl-qt_falta').val() ) {
        event.preventDefault();
    //    console.log('el1: ' + $('#ctrl-e1').val());
    //    console.log('el2: ' + $('#ctrl-qt_falta').val());
        alert('A quantidade entregue não pode ser maior que a quantidade por entregar!');
    }
});