As you are trying to this inside
onchange
event, so when the value of that
TextBox
will change, it will get fired.
As per the
num
, you just need to create the input boxes. Something like below.
for (var i = 0; i < num; i++)
{
var newTextBoxDiv = $(document.createElement('div'))
.attr("id", 'TextBoxDiv' + i);
newTextBoxDiv.after().html('<label>Textbox #'+ i + ' : </label>' +
'<input type="text" name="textbox' + i + <br mode=" hold=" /> '" id="textbox' + i + '" value="">');
newTextBoxDiv.appendTo("#TextBoxesGroup");
}</input>
Reference -
How To Add / Remove Textbox Dynamically With JQuery[
^]