It works only in half, I can get the value change but it seems to do it to all the row in collection and not just for one row
Here my code
$(document).ready(function(){
$('#q5').hide();
$('.cf-collection').change( function (){
$('.cf-collection > div').each(function (){
if ($('#q8 input[value="Yes"]').is(':checked')){
if ($(this).find('#q9 select option:selected').val() == 'Autofill Mileage'){
$(this).closest("div").find('#q6 input').val($('#q7 input').val());
$(this).closest("div").find('#q6 input').attr('disabled',true);
}else{
$(this).closest("div").find('#q6 input').val('');
$(this).closest("div").find('#q6 input').removeAttr('disabled');
}
}
});
});
});
When the expense is other than "Autofill Mileage" all GL code on all collection added become Blank.
I see that I do not point to the proper collection index
I also tried with this code
$(document).ready(function(){
$('#q5').hide();
$('.cf-collection').change( function (){
$('.cf-collection > div').each(function (){
$(this).find('#q9 select').change(function(){
if ($('#q8 input[value="Yes"]').is(':checked')){
if ($(this).find('#q9 select option:selected').val() == 'Autofill Mileage'){
$(this).closest("div").find('#q6 input').val($('#q7 input').val());
$(this).closest("div").find('#q6 input').attr('disabled',true);
}else{
$(this).closest("div").find('#q6 input').val('');
$(this).closest("div").find('#q6 input').removeAttr('disabled');
}
}
});
});
});
});
And it did not work at all
I do not figure how to point to the proper Dropdown selector in the collection.
I successely doinf an action to the proper row of the collection if I use a radio button field selector in place of a dropdown feild selector
$(this).find('#q5').click(function(){
Any thought?