Forum Moderators: open
<script type="text/javascript">
<!--
function getValue(obj) {
document.forms[0].field1.value = obj.options[obj.selectedIndex].value;
if (obj.selectedIndex==3 || obj.selectedIndex==1){
document.forms[0].field1.value = 999;
}
}
// -->
</script>
<div style="text-align: center;">
<strong>Sample</strong>
</div>
<form action="">
<p style="text-align: center;">
<select name="list1" onChange="getValue(this)">
<option value=""></option>
<option value="1">Option 1</option>
<option value="2">Option 2</option>
<option value="3">Option 3</option>
<option value="4">Option 4</option>
</select><br>
<input type="text" name="field1" size="15">
</p>
</form> For example's sake, those are not all of the array #s; they vary from the 20s to 100s based upon the table id in the database. But each list[] matches up with the field[] (same id[] numbers) that I want to populate with 999; once option 1 or option 3 is selected from the pull-down.