Muiter Posted February 16, 2010 Report 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 Report 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
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now