Skip to content

Instantly share code, notes, and snippets.

@alyjee
Created May 7, 2019 21:05
Show Gist options
  • Save alyjee/c8dfbd16bed09fa3b5d2a7878f94de88 to your computer and use it in GitHub Desktop.
Save alyjee/c8dfbd16bed09fa3b5d2a7878f94de88 to your computer and use it in GitHub Desktop.
A gist which contains secrets of Javascaript, jQuery and the family.
$('.add-new-payment').on('click', function(){
var received_amount = $('.payment-detail-row:last').find('.received_amount_input').val();
var remaining_amount = $('.payment-detail-row:last').find('.remaining_amount_input').val();
var receiving_date = $('.payment-detail-row:last').find('.mydatepicker').val();
if(
received_amount == '' || received_amount == null ||
remaining_amount == '' || remaining_amount == null ||
receiving_date == '' || receiving_date == null
){
// below two lines are not working for some reason
// let's find out :D
$('.payment-detail-row:last').find('.mydatepicker').css({opacity: 0});
$('.payment-detail-row:last').find('.mydatepicker').animate({opacity: 1}, 700 );
alert('Please fill the last added payment detail entry.');
return false;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment