asked on September 30, 2015
•
Show version history
I'm looking to pass the values of two fields into a dropdown in a table.
Here is the working code i have for passing those values into a dropdown outside of the table.
When replacing '#Field25' with #Field21(1)' nothing happens and when replacing it with '.droppy1' the class i gave to the dropdown field in the table it just adds another label under the field rather than add an item to the drop down list.
//Set dropdown
$('.test1').on('blur', 'input', fill0);
function fill0() {
//clear dropdown
$('#Field25').empty();
//append values
var numbers = [$('#q5 input').val(), $('#q17 input').val()];
var option = '';
for (var i=0;i<numbers.length;i++){
option += '<option value="'+ numbers[i] + '">' + numbers[i] + '</option>';
}
$('#Field25').append(option);
};
Any help would be greatly appreciated.
0
0