I have a select box that looks lik this:
<select name=”table” id=”table”>
<option value=”PNCST_CUSTOMER” <?if($table==”PNCST”) { echo ” selected”;} ?>>PNCST</option>
</select>
and I have 2 rows that have text boxes that look like this:
<tr valign=”top”>
<td width=”47%”>Customer Number:</td>
<td width=”53%”><input name=”cust_nbr” type=”text” id=”cust_nbr3″ size=”9″ maxlength=”9″ value=”<? echo $cust_nbr ?>”>
</td>
</tr>
<tr valign=”top”>
<td>Package ID:</td>
<td><input name=”pkgid” type=”text” id=”pkgid” size=”6″ maxlength=”9″ value=”<? echo $pkgid ?>”></td>
</tr>
What I would like to do, is if they select an option in the select box (right now there is only 1, but there will be plenty more), it shows the proper text boxes, for example, if I select PNCST from the dropdown, it shows me Customer Number and Package ID text boxes, but if I choose PNADR, it shows me an address text box. I don’t know JavaScript very much.
Any help is greatly appreciated!!
[i]Originally posted by Mr J [/i]
[B]I'd already started something like this, but Jona beat me to it[/B][/QUOTE]
Table:
<select name="table" id="table" onChange="chk(this.form.table.options[this.form.table.selectedIndex].value)">
<option value="PNCST_CUSTOMER">PNCST_CUSTOMER</option>
<option value="PNADR">PNADR</option>
<option value="Test 3">Test
3</option>
<option value="Test 4">Test
4</option>
</select>
<br>
<br>
<table border="0">
<tr valign="top">
0.1.9 — BETA 6.16