improve create table form to remember the type they chose
authorchriskl <chriskl>
Fri, 27 Dec 2002 04:06:28 +0000 (04:06 +0000)
committerchriskl <chriskl>
Fri, 27 Dec 2002 04:06:28 +0000 (04:06 +0000)
public_html/tables.php

index a5d381c443f39f7b76cd4caef28471d28c45e330..3f8742546b1a2722872c9f80dfa8ad8878ba2f41 100644 (file)
@@ -3,7 +3,7 @@
        /**
         * List tables in a database
         *
-        * $Id: tables.php,v 1.13 2002/12/24 07:35:26 chriskl Exp $
+        * $Id: tables.php,v 1.14 2002/12/27 04:06:28 chriskl Exp $
         */
 
        // Include application functions
                                        echo "<td><select name=\"type[{$i}]\">\n";
                                        $types->moveFirst();
                                        while (!$types->EOF) {
-                                               // @@@@@@@ MAKE THIS REMEMBER TYPE
-                                               echo "<option value=\"", htmlspecialchars($types->f[$data->typFields['typname']]), "\">",
-                                                       htmlspecialchars($types->f[$data->typFields['typname']]), "</option>\n";
+                                               $typname = $types->f[$data->typFields['typname']];
+                                               echo "<option value=\"", htmlspecialchars($typname), "\"",
+                                               (isset($_REQUEST['type'][$i]) && $typname == $_REQUEST['type'][$i]) ? ' selected' : '', ">",
+                                                       htmlspecialchars($typname), "</option>\n";
                                                $types->moveNext();
                                        }
                                        echo "</select></td>";