DHTMLX Docs & Samples Explorer

Index
dhtmlxform

# Loading selectbox options

dhtmlxForm provides a simple way to control list of options. Instead of fetching data from DB and forming list of options manually you can use special options connector.

On client side:

    <select connector="options.php" ></select>

on server side:

    require_once('form_connector.php');
     //$conn - database connection, result of mysql_connect
    $options = new SelectOptionsConnector($conn);
    $options->render_sql("SELECT Id, Package FROM packages_plain WHERE Id < 50","","Id,Package");

Of course target selectbox element must be inside html container of dhtmlxForm object, to activate such behavior.

The url, which used for data loading, may contain any extra params , which will be available in server side code

    <select connector="options.php?master=1631" ></select>