christamcc
asked on
Drop Down loading slowly
My php populated drop down loads exceptionally slowly.
The code is in the form. I also tried to assign it to a variable at the top of the page and then echo the variable at the correct point in the form, but that didn't change the speed.
Suggestions on how to speed it up?
The code is in the form. I also tried to assign it to a variable at the top of the page and then echo the variable at the correct point in the form, but that didn't change the speed.
<select name="year" style="width: 70px;">
<option>Year</option>
<?php
$current_year = Date("Y");
$year_dropdown = '';
$selected = '';
for ($i = ($current_year - 80); $i <= ($current_year); $i++) {
if(isset($trimmed['year']) && ($trimmed['year'] == $i))
$selected = ' selected="selected" ';
$year_dropdown .= '<option ' . $selected . 'value="'. $i . '">' . $i . '</option>';
}
?>
</select>
Suggestions on how to speed it up?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.