forumsudhir Posted May 25, 2008 Share Posted May 25, 2008 how to call php function by combobox select event through javascript.................... Quote Link to comment Share on other sites More sharing options...
vurentjie Posted May 25, 2008 Share Posted May 25, 2008 if i am not mistaken, this is not possible, as php gets processed first,then javascript, i might be wrong Quote Link to comment Share on other sites More sharing options...
forumsudhir Posted May 26, 2008 Author Share Posted May 26, 2008 i just want to handle combobox event in php web page so pls tall me what should i do....... Quote Link to comment Share on other sites More sharing options...
vurentjie Posted June 4, 2008 Share Posted June 4, 2008 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.