1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-27 03:21:53 +03:00
samba-mirror/swat/esptest/formtest.esp
Andrew Tridgell 580b5bb8ef r7132: - start a convention of making object constructors end in Obj, so we
now have FormObj(). This follows the style in the ejs manual

- make a new MenuObj object type, with a display_menu() to display
  it. This will make it easier to make different types of
  menus. Currently only veritical simple menus are supported.
(This used to be commit ac978d4124)
2007-10-10 13:17:20 -05:00

34 lines
785 B
Plaintext

<% page_header("columns", "ESP Form Test"); %>
<%
var f = FormObj("FormTest", 3, 2);
f.element[0].label = "First Name";
f.element[0].name = "firstName";
f.element[0].value = form['firstName'];
f.element[1].label = "Last Name";
f.element[1].name = "lastName";
f.element[1].value = form['lastName'];
f.element[2].label = "Color";
f.element[2].type = "select";
f.element[2].list = new Array("Red", "Green", "Blue", "Yellow");
f.element[2].value = form['Color'];
f.submit[0] = "OK";
f.submit[1] = "Cancel";
display_form(f);
<%
/* if its a post then the user has filled in the form, so
report the values
*/
if (form['submit'] == "OK") {
%>
You chose firstName=@@form['firstName'] lastName=@@form['lastName']<p>
<%
simple_table(form);
}
%>
<% page_footer(); %>