help extending help code sample (dropdown select) |
5/8/2010 4:58:26 PM |
PHPRunner General questions | |
A
AlexOZ author
In the help there is a code sample for "Add dropdown list box with values for search" http://xlinesoft.com/phprunner/docs/add_dropdown_list_box_with_values_for_search.htm |
|
![]() |
Sergey Kornilov admin 5/10/2010 |
Try this (see my changes in red): //create dropdown box $str = ""; $str.= "<select onchange=\"window.location.href=this.options[this.selectedIndex]. value;\"><option value=\"\">Please select</option>"; //select values from database global $conn; $strSQL = "select company from tablename"; $rs = db_query($strSQL,$conn); while ($data = db_fetch_array($rs)) $str.="<option value=\"tablename_list.php?ctlSearchFor=".$data["[b][color="#FF0000"]id"]. "&srchOptShowStatus=1&ctrlTypeComboStatus=0&srchWinShowStatus=0&a=integrated&id=1&criteria=and&type1=&value11=". $data["id"]."&field1=company&option1=Contains¬1=a=search&value=1\">".$data["company"]."</option>"; $str.="</select>"; echo $str; |