Posting this to jQuery specific forums as well, but thought I would try here since I am not sure if this is specific to the way AG handles the select inputs. At any rate, trying to get a select value and use it in a .each function. If I use the following code I get the correct value and send it to my ajax script.
Code: Select all
$j('#tax_code-container').on('change',function(){
var taxid=$(this).value;
However, when I tried changing this function (below) to catch changes on multiple inputs, I am no longer able to get the value of the select. Console tells me
"Cannot read property 'val' of null". I can't understand why it finds the element/value when using
$(this) and not when using the direct id of the element. All of the jQuery documentation and examples I can find say this should work.
Code: Select all
$j.each(orderFields, function(index, value) {
$j(value).on('change',function(){
var taxid=$('#tax_code-container').val();
Tried taking out the each function and just running alone but get same error, so the each function is not the cause.
Again, I know this may not be specific to AppGini but if anyone has any ideas I will be most grateful! Or you can tell me to go study some more
Brandon