Looking at this jQuery example, how can I modify the code so that it only changes the color of the cell if the value of the submit button in that cell is a certain value.
i.e.-
var submitEl = $("td :submit")
//Only do the below if the submit buttons value is "XYZ"
.parent('td')
.css({background:"yellow", border:"3px red solid"})
$("td input[value='SomeValue']:submit")
var submitEl = $('td :submit').filter(function() { return $(this).val() == "certain"; });
You can check for the value in the selector, but it may lead to quoting headaches (depending on the value) and also it may not be quite as fast (though that's rarely a serious concern).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With