Hi:
I have the following code which I inherited from a project I got assigned... I am trying to learn PHP along with this... So I have a listbox here that I just want to display the selected value and not the entire list... And this is read only so that the user can not change it or do anything to it...
Any help would be appreciated.. Thanks
I have the following code which I inherited from a project I got assigned... I am trying to learn PHP along with this... So I have a listbox here that I just want to display the selected value and not the entire list... And this is read only so that the user can not change it or do anything to it...
Code:
<select multiple size="10" name="preferred_locations[]">
<?php
$arrRegions = explode("\n", aParameter(802));
//echo "<table width=100%>";
foreach($arrRegions as $strRegion)
{
$arrCategoryItems = explode(".",$strRegion,2);
if(strstr($arrCategoryItems[0],"."))
{
continue;
}
if($iCounter%2==0)
{
//echo "<tr height=24>\n";
}
//echo "<td class=text>\n";
//echo "\n <option ".(in_array(trim($arrCategoryItems[1]), $arrSelectedLocations)?"selected":"")." value=\"".trim($arrCategoryItems[1])."\" name=\"preferred_locations[]\"> ".$arrCategoryItems[1]."</option>";
echo "\n <option ".(in_array(trim($arrCategoryItems[1]), $arrSelectedLocations)?"selected":"")." value=\"".trim($arrCategoryItems[1])."\" name=\"preferred_locations[]\"> ".$arrCategoryItems[1]."</option>";
//echo "\n <input disabled type=checkbox ".((is_array($arrSelectedLocations)&&in_array(trim($arrCategoryItems[1]), $arrSelectedLocations))?"checked":"")." value=\"".trim($arrCategoryItems[1])."\" name=\"preferred_locations[]\"> ".$arrCategoryItems[1];
//echo "</td>\n";
if(($iCounter+1)%2==0)
{
//echo "</tr>\n";
}
$iCounter ++;
}
// echo "</table>";
?>
</select>