I was wondering if their is an easier way to do this; I want to select a number one through twelve from a dropdown and display that many textboxes and their labels this is how im setting it up.
<script>
$(document).ready(function() {
$('#one').hide();
$('#two').hide();
$('#three').hide();
$('#four').hide();
$('#five').hide();
$('#six').hide();
$('#seven').hide();
$('#eight').hide();
$('#nine').hide();
$('#ten').hide();
$('#eleven').hide();
$('#twelve').hide();
$('#quantity').change(function() {
dropdown = $('#quantity').val();
if (dropdown == '1')
{
$('#one').show();
}
if (dropdown == '2')
{
$('#one').show();
$('#two').show();
}
if (dropdown == '3')
{
$('#one').show();
$('#two').show();
$('#three').show();
}
if (dropdown == '4')
{
$('#one').show();
$('#two').show();
$('#three').show();
$('#four').show();
}
});
});
</script>
</head>
<body>
<form id="packForm" action="" method="post">
<fieldset>
<legend>Packout</legend>
<ul>
<li>
<label>How many units to packout?:</label>
<select id="quantity" name="quantity" class="validate[required]">
<option value="">Choose a quantity...</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
</select>
</li>
<li id="one" >
<label>ISN 1:</label>
<input type="text" id="ISN1" name="ISN1" maxlength="12" class="validate[required],validate[custom[hex]]"/></li>
<li id="two">
<label>ISN 2:</label>
<input type="text" id="ISN2" name="ISN2" maxlength="12" class="validate[required],validate[custom[hex]]"/></li>
<li id="three">
<label>ISN 3:</label>
<input type="text" id="ISN3" name="ISN3" maxlength="12" class="validate[required],validate[custom[hex]]"/></li>
<li id="four">
<label>ISN 4:</label>
<input type="text" id="ISN4" name="ISN4" maxlength="12" class="validate[required],validate[custom[hex]]"/></li>
<li id="five">
<label>ISN 5:</label>
<input type="text" id="ISN5" name="ISN5" maxlength="12" class="validate[required],validate[custom[hex]]"/></li>
<li id="six">
<label>ISN 6:</label>
<input type="text" id="ISN6" name="ISN6" maxlength="12" class="validate[required],validate[custom[hex]]"/></li>
<li id="seven">
<label>ISN 7:</label>
<input type="text" id="ISN7" name="ISN7" maxlength="12" class="validate[required],validate[custom[hex]]"/></li>
<li id="eight">
<label>ISN 8:</label>
<input type="text" id="ISN8" name="ISN8" maxlength="12" class="validate[required],validate[custom[hex]]"/></li>
<li id="nine">
<label>ISN 9:</label>
<input type="text" id="ISN9" name="ISN9" maxlength="12" class="validate[required],validate[custom[hex]]"/></li>
<li id="ten">
<label>ISN 10:</label>
<input type="text" id="ISN10" name="ISN10" maxlength="12" class="validate[required],validate[custom[hex]]"/></li>
<li id="eleven">
<label>ISN 11:</label>
<input type="text" id="ISN11" name="ISN11" maxlength="12" class="validate[required],validate[custom[hex]]"/></li>
<li id="twelve">
<label>ISN 12:</label>
<input type="text" id="ISN12" name="ISN12" maxlength="12" class="validate[required],validate[custom[hex]]"/></li>
</ul>
</fieldset>
</form>
</body>
</html>