Hello Everyone I have used jquery to generate a textbox.It is generated dynamically through jquery.Now the problem is i want to fetch the textbox value in ajax function and then
This is because you are not setting a value to the variable dynamic_text
:
var dynamic_text;
As such it's value will be undefined
. And clearly undefined
doesn't have a .push()
method; that's what the error is saying:
Cannot read property 'push' of undefined
You will want to define your variable as an array:
var dynamic_text = [];