showing undefined data and cannot find my dropdown id

Viewed 25

I have question about the query selector, because I am passing a lot of function for my textboxes that will update different chart when using the dropdown list. I am always getting undefined in my console.log() Undefined screenshot this is my drop down Dropdown Screenshot.

const selectory = $('#needed').filter(":selected").val();
//const selectory = $("div.chartNine select").val();
function interactiveChart() {
    console.log(selectory)
    console.log(bzvaqxnufhyd1.value)
    if (selectory == 'vdn6') {
    updatingValue = [bzvaqxnufhyd1.value, bzvaqxnufhyd2.value, bzvaqxnufhyd3.value, bzvaqxnufhyd4.value, bzvaqxnufhyd5.value, bzvaqxnufhyd6.value, bzvaqxnufhyd7.value];
    nineChart2.data.datasets[0].data = updatingValue;
    nineChart2.update();
    nineChart2.render(); }
}

needed is my id tag for my select under the div chartNine. and this is my textbox

<input type="text3" id="bzvaqxnufhyd1" onchange="interactiveChart()" value="0" />

I will be using that function for 7 different charts that is why I need to have that select value so whenever I selected a new drop down, if else will do the magic in my interactiveChart function. I hope someone can help me or lighten me up regarding my situation. Thank you.

1 Answers

Solved. I just added multifunction on my textbox which is this one.

<input type="text3" id="bzvaqxnufhyd1" onchange="interactiveChart()" value="0" />
Related