Jump to content

javascript event handling with php


forumsudhir

Recommended Posts

  • 2 weeks later...

hi, sorry was away for a while from these forums.

 

basically your best bet if you want to manipuate combo boxes with php is to look at the following code snippet and learn something perhaps, not the most difficult but could get you started

 

 
$comparr[0]="Trade in firearms";
$comparr[1]="Manufacture firearms";
$comparr[2]="Conduct Business as a gunsmith";
$comparr[3]="Possess a firearm";


$compopt = "<option value=''> </option>";

for($ee = 0; $ee <=3; $ee++)
{
     if($comparr[$ee] == $row['type'])
     {
    $compopt .= "<option selected='yes' value='".$comparr[$ee]."'>".$comparr[$ee]."</option>";
     }
    else
    {
    $compopt .= "<option value='".$comparr[$ee]."'>".$comparr[$ee]."</option>";
    }
}

 

in this example what gets played on is whether a mysql search result is the same as any predefined select items and if so it automatically gets selected.

 

but actually javascript is the best way to do this stuff

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.