[eluser]Byzs[/eluser]
[quote author="deed02392" date="1345537616"]You're creating multiple SELECT elements in this code, not one select element with <option>'s, which is what I think you are supposed to be doing.
You need to read about what the HTML for a proper SELECT looks like.
Then read about accessing options in a SELECT from JavaScript (preferably with a library, like jQuery).
This should give you enough knowledge to achieve what you want.[/quote]
Thanks for the reply deed02392, yes I'am creating multiple's <select> to reduce the information per <select> I have.
What I did not include in this code (ouch) is that I'am creating multiple <options> per every <select>....anyway what I'am trying to archive is to select a specific option of a <select> throw an other <select> with Javascript.
Here it is the complete code:
Code:
$modOr[0]="HCS";
$modOr[1]="CN";
$modOr[2]="CAD";
$modOr[3]="FG";
$modOr[4]="FOCSH";
$modOr[5]="FOCN";
$modOr[6]="FOAM";
for($m=0; $m<7; $m++)
{
if($m==0)
echo("<div id='div".$modOr[$m]."' ");
else
echo("<div id='div".$modOr[$m]."' ");
echo("<select id='curr".$modOr[$m]."'>");
foreach ($curr->result_array() as $cur)
{
if($cur["databaseTable"]==$modOr[$m]){
echo("<option value='".$cur['databaseValue']."'>".$cur['databaseValue']."</option>");
}
}
echo("</select>");
echo("</div>");
}
Sorry for the mistake
PD: on line 12 there is a "style = 'display : block'" and for line 14 the same but with display "none"...that for some reason is not appearing, thats why I'am using the "if($m==0)"