Code: Select all
andCode: Select all
tags where appropriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
Hi,
I have a form where the user selects a piece of equipment from a list box and then the placement of this equipment is to be drawn from a database (Oracle) and written to a text field on the same form. Then there is a second list box where the user can select a new placement and submit it. I have a form action linking to another page but this is only to be invoked when the user presses SUBMIT. The problem here is to draw the placement and write it to the text field as soon as the user has selected an equipment. Can someone suggest a solution.
I include a piece of the source just in case:Code: Select all
<form action="taeki_handle_breytt_stadsetn.php" method="post" enctype="application/x-www-form-urlencoded" name="Viðhalda einingaskrá" id="Viðhalda einingaskrá">
<fieldset>
<legend>Veljið mælitæki og nýja staðsetningu hér að neðan:</legend>
<p> </p>
<table width="333" border="0" align="center">
<tr>
<td width="134">Mælitæki</td>
<td width="143"><select name="s_taeki" id="s_taeki" onChange="alert('You Chose '+this.form.dir.value);">
<?php for($N=0;$N<sizeof($Maelitaeki);$N++){?>
<option value="<?php echo($Maelitaeki[$N][1]);?>"><?php echo($Maelitaeki[$N][0]);?></option>
<?php }?>
</select></td>
</tr>
<tr>
<td>Núverandi staðsetning</td>
<td><input name="t_nuv_stadur" type="text" id="t_nuv_stadur" /></td>
</tr>
<tr>
<td>Ný staðsetning</td>
<td>
<select name="s_nyr_stadur" id="s_nyr_stadur">
<?php for($N=0;$N<sizeof($Stadarheiti);$N++){?>
<option value="<?php echo($Stadarheiti[$N][1]);?>"><?php echo($Stadarheiti[$N][0]);?></option>
<?php }?>
</select> </td>
</tr>
</table>
<br>
<br>
<p>
<div align="center">
<input name="b_skra" type="submit" id="b_skra" value="Framkvæma" />
<input name="b_haetta_vid" type="reset" id="b_haetta_vid" value="Hætta við" />
</div>
</p>
</fieldset>
</form>Thanks,
Kalli
feyd | Please use
Code: Select all
andCode: Select all
tags where appropriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]