Takéto niečo?
<form method="get" action="">
Počet obrázků : <input id="count" size="2" maxlength="2"> (max.: 6)
<div id="inputs"></div>
<div id="images"></div>
<input id="submit" type="submit" />
</form>
<script>
var count = document.getElementById('count');
var inputs = document.getElementById('inputs');
var images = document.getElementById('images');
var bindInput = function(input, fn) {
input.oninput = function(e) {
this.onkeydown = null;
fn.call(this, e);
};
input.onkeydown = function(e) {
fn.call(this, e);
};
};
var onInput = function(e) {
e = e || window.event;
var target = e.target || e.srcElement;
if (target.timer) {
clearTimeout(target.timer);
target.timer = null;
}
for (var input = inputs.firstChild, i = 0; input; input = input.nextSibling, ++i)
if (input == target) {
target.timer = setTimeout(function() {
images.childNodes[i].src = target.value;
target.timer = null;
}, 500);
break;
}
};
var onCountInput = function(e) {
var count = Math.max(1, Math.min(6, this.value));
if (isNaN(count))
count = 1;
var actual = inputs.childNodes.length;
while (count < actual--) {
inputs.removeChild(inputs.lastChild);
images.removeChild(images.lastChild);
}
while (++actual < count) {
var input = document.createElement('input');
input.name = 'cislo' + (actual + 1);
bindInput(input, onInput);
inputs.appendChild(input);
var image = new Image();
images.appendChild(image);
}
}
bindInput(count, onCountInput);
onCountInput.call(count);
</script>