Muiter Posted February 16, 2010 Share Posted February 16, 2010 The script below is working fin but I want to use the form in an for loop, how to change te form and JS te keep it working?<script> function bewerking_uren(form) { form.bewerking_tarief.value = form.bewerking.options[form.bewerking.selectedIndex].value } </script> <td><select name="bewerking" onChange="bewerking_uren(this.form)"> <option></option> <?php $sql_bewerking = "SELECT omschrijving, tarief from sp_calc_werkzaamheden ORDER BY omschrijving ASC"; $res_bewerking = mysql_query($sql_bewerking,$con); while ($row_bewerking = mysql_fetch_assoc($res_bewerking)){ ?> <option value=<?php echo $row_bewerking["tarief"] ?>><?php echo $row_bewerking["omschrijving"] ?></option> <?php } ?></select> </td> <td><input type="text" name="bewerking_tarief" size="5" value=" /></td>The original script can be found at http://mld.ursinus.edu/~jarana/Colby/template1.html Link to comment Share on other sites More sharing options...
justsomeguy Posted February 16, 2010 Share Posted February 16, 2010 What do you mean you want to use the form in a for loop? A form is an element, and a for loop is a programming control structure. How exactly do you want an element and control structure to work together? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.