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

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.