Greetings Maqsood,
I don't know why you posted this in PHP, unless you want to send the user back to the server every time he/she selects a new number.
This can be accomplished much more easily with JavaScript
:
<script type='text/javascript'>
var divs = new array();
divs[0] = document.getElementById('a');
divs[1] = document.getElementById('b');
divs[2] = document.getElementById('c');
divs[3] = document.getElementById('d');
divs[4] = document.getElementById('e');
function showBoxes(howMany)
{
howMany--;
hideBoxes; //hide them all, so we can show how many we want
for(var i = 0; i < howMany; i++)
{
divs[i].style.visibility = 'visible';
}
}
function hideBoxes()
{
for(var i = 0; i < 5; i++)
{
divs[i].style.visibility = "hidden";
}
}
</script>
HOW MANY:
<select onchange='showBoxes(this.options[this.selectedIndex].text)'>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
</select>
<br/>
<div id='a'>
<input type='text'/>
</div>
<div id='b'>
<input type='text'/>
</div>
<div id='c'>
<input type='text'/>
</div>
<div id='d'>
<input type='text'/>
</div>
<div id='e'>
<input type='text'/>
</div>
Try it and tell me if it works.
HTH,
Snib
<><