I have a php page that generates a list of stock items and I want to determine if the table td for the stock items are empty so that I can run a jquery script that states that we either have the stock item or not.
jQuery(document).ready(function() {
if ($("#paperId:empty")) {
$('#tablebox').append("<h2 class=\"floatclear\">There is stock that matches your search parameters.</h2>");
} else {
$("table").hide();
$('#papernav').hide();
$('#tablebox').append("<h2 class=\"floatclear\">No Stock is currently available.</h2>");
}
})
I think that I should be running this with every submit but don't know how?