Each one of these rows has a selection box in the first column.
I want the selection box that is at the top of all of these rows of data to fill the same value in as it if I select a value from it.
So if I select "Apples" from the selection box at the top of the table of data rows then all of the selection boxes in the table below would fill in with Apples.
Here is the code that the selection box at the top of the table of data rows has:
Code: Select all
<select name="assign_all" class="mediumInput">
<option value="">Select An Inspector</option>
<?php
$result1 = mysql_query("SELECT * FROM users WHERE account_type='Inspector' ORDER BY username ASC");
while($row1 = mysql_fetch_array($result1)) {
?>
<option value="<?php echo $row1["user_code"]; ?>"><?php echo $row1["username"]; ?></option>
<?php
}
?>
</select>Code: Select all
<select name="inspector[<?php echo $row["id"]; ?>]" class="smallInput">
<option value="">Select An Inspector</option>
<?php
$result1 = mysql_query("SELECT * FROM users WHERE account_type='Inspector' ORDER BY username ASC");
while($row1 = mysql_fetch_array($result1)) {
?>
<option value="<?php echo $row1["user_code"]; ?>"><?php echo $row1["username"]; ?></option>
<?php
}
?>
</select>