[jQuery] How can I simplify these code

[jQuery] How can I simplify these code


Hi,
my script is working exactly. I want to know, how I can simplify these
Javascriptcode.
Demo: http://hans-drewes.de/selectbox.html
Code selectbox.php
<pre>
require_once('sql.inc.php');
require("Classes/db.class.php");
$db = new db_query;
if(isset($_POST['id'])) {
    if(strlen($_POST['id']) >0) {
        if($_POST['db'] == "Uebersicht") $db->execute("SELECT * FROM
Uebersicht WHERE Kategorie_id = '".$_POST['id']."' ORDER BY Uebersicht
ASC");
        if($_POST['db'] == "Objekt") $db->execute("SELECT * FROM Objekt
WHERE Uebersicht_id = '".$_POST['id']."' ORDER BY Objekt ASC");
        $v = '<option value="" selected="">'.$_POST['val'].'</option>';
        while ($db->next()) {
            $v .= '<option value="'.$db-


















    • Topic Participants

    • mg