diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-05-30 08:23:37 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:17:15 -0500 |
commit | 9b8546f92179dba826e7ca5ed009b24486ef7a2c (patch) | |
tree | 752f77d33a50d00d75d57d3dcb5cee8922899ced /swat | |
parent | ddccf6d2f5c4757111010e3116b41e379a7dc2dd (diff) | |
download | samba-9b8546f92179dba826e7ca5ed009b24486ef7a2c.tar.gz |
r7094: use the Form() object in a few more places
Diffstat (limited to 'swat')
-rw-r--r-- | swat/esptest/exception.esp | 10 | ||||
-rw-r--r-- | swat/esptest/formtest.esp | 2 | ||||
-rw-r--r-- | swat/esptest/session.esp | 21 |
3 files changed, 18 insertions, 15 deletions
diff --git a/swat/esptest/exception.esp b/swat/esptest/exception.esp index cfd0f312fab..986b616dabc 100644 --- a/swat/esptest/exception.esp +++ b/swat/esptest/exception.esp @@ -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"; diff --git a/swat/esptest/formtest.esp b/swat/esptest/formtest.esp index 2d3693355cc..6dd1f911ea5 100644 --- a/swat/esptest/formtest.esp +++ b/swat/esptest/formtest.esp @@ -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> diff --git a/swat/esptest/session.esp b/swat/esptest/session.esp index ec747df4429..6de7edab674 100644 --- a/swat/esptest/session.esp +++ b/swat/esptest/session.esp @@ -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 */ |