r7094: use the Form() object in a few more places
authorAndrew Tridgell <tridge@samba.org>
Mon, 30 May 2005 08:23:37 +0000 (08:23 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:17:15 +0000 (13:17 -0500)
(This used to be commit 9b8546f92179dba826e7ca5ed009b24486ef7a2c)

swat/esptest/exception.esp
swat/esptest/formtest.esp
swat/esptest/session.esp

index cfd0f312fab86ab928376ca99b9534baebd1ba0b..986b616dabcc77bb0b60b717040d9954aa3d2ca5 100644 (file)
@@ -2,12 +2,14 @@
 
 <h1>Samba4 exception test</h1>
 
-<form name="ExceptionTest" method="POST" action="@@request['SCRIPT_NAME']"> 
-    <input name="submit" type="submit" value="Generate Exception">
-    <input name="submit" type="submit" value="No Exception">
-</form>
 
 <%
+var f = Form("ExceptionTest", 0, 2);
+f.submit[0] = "Generate Exception";
+f.submit[1] = "No Exception";
+
+display_form(f);
+
 if (request['REQUEST_METHOD'] == "POST") {
        function TestFunction(arg1, arg2) {
                 return "OK";
index 2d3693355cc124fdcb0e8800c257197cf2dbe538..6dd1f911ea5410a3179e09da9139fedf403d3776 100644 (file)
@@ -15,7 +15,7 @@ display_form(f);
   /* if its a post then the user has filled in the form, so
      report the values 
   */
-  if (form['OK']) {
+  if (form['submit'] == "OK") {
 %>
   You chose firstName=@@form['firstName'] lastName=@@form['lastName']<p>
   
index ec747df4429261c56fc24338c8f065866fba32d9..6de7edab67403d9dfec48122fb8eb2d76103780a 100644 (file)
@@ -2,17 +2,18 @@
 
 <h1>Samba4 session test</h1>
 
-<form name="SessionTest" method="POST" action="@@request['SCRIPT_NAME']"> 
-    Name:   <input name="Name"  type="text" value=""><br>
-    Value:  <input name="Value" type="text" value=""><br>
-    Timeout: <input name="Timeout" type="text" value=""><br>
-    <input name="submit" type="submit" value="Append">
-    <input name="submit" type="submit" value="Reset">
-    <input name="submit" type="submit" value="Destroy">
-    <input name="submit" type="submit" value="Cancel"><br>
-</form>
-
 <%
+var f = Form("SessionTest", 3, 4);
+f.element[0].label = "Name";
+f.element[1].label = "Value";
+f.element[2].label = "Timeout";
+f.submit[0] = "Append";
+f.submit[1] = "Reset";
+f.submit[2] = "Destroy";
+f.submit[3] = "Cancel";
+
+display_form(f);
+
   /* if its a post then the user has filled in the form, so
      report the values 
   */