Jump to content

many input boxes that the user selects


webtuto

Recommended Posts

JS:

function setInputs(num){
  var i;
  var div = "";
  for (i=1;i<=num;i++){
    div += "<input type='text' name='text[]'>";
  }
  document.getElementById('texts').innerHTML = div;
}

 

HTML:

<input type="text" onchange="setInputs(this.value);">
<div id="texts"></div>

 

This should get you started.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.