I'm trying to iterate through a list of input boxes so that they activate a JQuery autocomplete function whenever the input is changed. Here is the relevant code:
for(i=0;i<30;i++)
{
$("#_Q6_Q" + i + "_Q3_C").change(transportChange($("#_Q6_Q" + i +"_Q3_C").value(), i));
};
However I get this error:
TypeError: ($("#_Q6_Q" + i) + "_Q3_C").value is not a function.
I have no idea what to do to fix this.
Edit 1: I added the $ to the function arguments, which hasn't solved the issue (it was there before).
Doing some digging around led me to try and remove the () from .value(). the function now passes through without an error. However it also doesn't do anything. The code now looks like this:
for(i=0;i<30;i++)
{
$("#_Q6_Q" + i + "_Q3_C").change(transportChange($("#_Q6_Q" + i +"_Q3_C").value(), i));
};