...

View Full Version : adding options



Diod
01-09-2006, 04:48 PM
It doesnt add any options:


if ($settingsa['Text?'] == 0) {
echo '<th width="455" scope="row"><select name="select">';
$ListVals = explode(";", $settingsa['ListVals']);
for ($i = 0; $i == count($ListVals); $i++)
{
echo '<option value="' . $ListVals[$i] . '">' . $ListVals[$i] . '</option>';
}
echo '</select></th>';
}

If i do

if ($settingsa['Text?'] == 0) {
echo '<th width="455" scope="row"><select name="select">';
$ListVals = explode(";", $settingsa['ListVals']);

echo '<option value="' . $ListVals[0] . '">' . $ListVals[0] . '</option>';

echo '</select></th>';
}
It does show the first element, but ofcourse not the second, why doesnt the first one work?

mlse
01-09-2006, 04:58 PM
if ($settingsa['Text?'] == 0) {
echo '<th width="455" scope="row"><select name="select">';
$ListVals = explode(";", $settingsa['ListVals']);
for ($i = 0; $i < count($ListVals); $i++) //You had "==" instead of "<"
{
echo '<option value="' . $ListVals[$i] . '">' . $ListVals[$i] . '</option>';
}
echo '</select></th>';
}


:)

Diod
01-10-2006, 12:39 PM
Thx! Works great



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum