Reputation: 55
i have a selection with 3 options values . i want to auto generate html input based on selection if user select 2 it show to him two text inputs with same id for both shown.
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
Upvotes: 0
Views: 445
Reputation: 1332
try this i used jquery
https://jsfiddle.net/rkv88/grym5fqv/
On event .change() {
hide every text input;
for loop N times N is the option number{
show that text element until N index
}
}
Upvotes: 1