I'm attempting to create an online personality test for a client I am having troubles making form elements updated a table the way I would like them to. The page has eight different color squares with a select form element below each square and option values between 1 and 25. When the user selects the value (25 being most liked and 1 being least for that color) there is a table below the colors with two rows of 25 squares that I would like to update based on the selection. For example for the first selector the color is a dark green, if the user was to select the number 22 then I would like the cell below the the cell marked 22 to turn dark green. In addition the user should only be able to select a particular value only once as the same number cannot be assigned multiple colors. Any help is greatly appreciated.
<img value="4" src="sft/images/color4.jpg" draggable="true" ondragstart="drag(event)">
<img value="2" src="sft/images/color2.jpg" draggable="true" ondragstart="drag(event)">
<img value="3" src="sft/images/color3.jpg" draggable="true" ondragstart="drag(event)">
<img value="1" src="sft/images/color1.jpg" draggable="true" ondragstart="drag(event)">
<form name="colorselect" action="#">
<select name="color4" style="width:150px; margin-bottom: 10px; background-color: #0f6700; color: #ffffff">
<option value=""> </option>
<?php
$option = '1';
while ($option <= '25'){
echo '<option value=/"'.$option.'">'.$option.'</option>';
$option ++;
}
?>
</select>
<select name="color2" style="width:150px;margin-bottom: 10px; background-color: #701b55; color: #ffffff">
<option value=""> </option>
<?php
$option = '1';
while ($option <= '25'){
echo '<option value=/"'.$option.'">'.$option.'</option>';
$option ++;
}
?>
</select>
<select name="color3" style="width:150px;margin-bottom: 10px; background-color: #ee8400; color: #ffffff">
<option value=""> </option>
<?php
$option = '1';
while ($option <= '25'){
echo '<option value=/"'.$option.'">'.$option.'</option>';
$option ++;
}
?>
</select>
<select name="color1" style="width:150px;margin-bottom: 10px; background-color: #00243c; color: #ffffff">
<option value=""> </option>
<?php
$option = '1';
while ($option <= '25'){
echo '<option value=/"'.$option.'">'.$option.'</option>';
$option ++;
}
?>
</select>
<img value="6" src="sft/images/color6.jpg" draggable="true" ondragstart="drag(event)">
<img value="5" src="sft/images/color5.jpg" draggable="true" ondragstart="drag(event)">
<img value="7" src="sft/images/color7.jpg" draggable="true" ondragstart="drag(event)">
<img value="8" src="sft/images/color8.jpg" draggable="true" ondragstart="drag(event)">
<select name="color6" style="width:150px;margin-bottom: 10px; background-color: #74bf12; color: #ffffff">
<option value=""> </option>
<?php
$option = '1';
while ($option <= '25'){
echo '<option value=/"'.$option.'">'.$option.'</option>';
$option ++;
}
?>
</select>
<select name="color5" style="width:150px;margin-bottom: 10px; background-color: #b00917; color: #ffffff">
<option value=""> </option>
<?php
$option = '1';
while ($option <= '25'){
echo '<option value=/"'.$option.'">'.$option.'</option>';
$option ++;
}
?>
</select>
<select name="color7" style="width:150px;margin-bottom: 10px; background-color: #000000; color: #ffffff">
<option value=""> </option>
<?php
$option = '1';
while ($option <= '25'){
echo '<option value=/"'.$option.'">'.$option.'</option>';
$option ++;
}
?>
</select>
<select name="color8" style="width:150px;margin-bottom: 10px; background-color: #FFFFFF">
<option value=""> </option>
<?php
$option = '1';
while ($option <= '25'){
echo '<option value=/"'.$option.'">'.$option.'</option>';
$option ++;
}
?>
</select>
</form>
<table id="sftTable">
<tr>
<td colspan="5" style="border-top:none;border-right:none;border-left:none">Strong Like</td>
<td colspan="5" style="border-top:none;border-right:none;border-left:none">Like</td>
<td colspan="5" style="border-top:none;border-right:none;border-left:none">Nuetral</td>
<td colspan="5" style="border-top:none;border-right:none;border-left:none">Dislike</td>
<td colspan="5" style="border-top:none;border-right:none;border-left:none">Strong Dislike</td>
</tr>
<tr>
<?php $count = '25';
while ($count >= '1' ) {
echo '<td width=/"30px/">'.$count.'</td>';
$count --;
}
?>
</tr>
<tr height="30px">
<?php $count = '25';
while ($count >= '1' ) {
echo '<td width=/"30px/" id=/"'.$count.'"> </td>';
$count --;
}
?>
</tr>
</table>