summaryrefslogtreecommitdiff
path: root/swat/scripting
diff options
context:
space:
mode:
authorDeryck Hodge <deryck@samba.org>2005-08-10 19:25:07 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:31:34 -0500
commit55024676c7ab56189bb7089bae1569e34dcdf458 (patch)
tree607db686f6a32a8f93af705426387c210bc79544 /swat/scripting
parentd3751c45258a1fac9eb2117fcc67bab0159b730c (diff)
downloadsamba-55024676c7ab56189bb7089bae1569e34dcdf458.tar.gz
samba-55024676c7ab56189bb7089bae1569e34dcdf458.tar.bz2
samba-55024676c7ab56189bb7089bae1569e34dcdf458.zip
r9230: Star out passwords and add confim text input for provisioning.
Also, add addMethod() to form elements now. deryck (This used to be commit 79f276df47ebc93e1505c7411fb1acd4b004047c)
Diffstat (limited to 'swat/scripting')
-rw-r--r--swat/scripting/forms.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/swat/scripting/forms.js b/swat/scripting/forms.js
index e44deeb180..2de9e34462 100644
--- a/swat/scripting/forms.js
+++ b/swat/scripting/forms.js
@@ -10,6 +10,8 @@
f.action = action to be taken on submit (optional, defaults to current page)
f.class = css class (optional, defaults to 'form')
f.submit = an array of submit labels
+ f.add(name, label, [type], [value]) =
+ Add another element
f.element[i].label = element label
f.element[i].name = element name (defaults to label)
f.element[i].type = element type (defaults to text)
@@ -69,6 +71,22 @@ function form_display() {
write("</form>\n");
}
+function __addMethod(name, label)
+{
+ var f = this;
+ var i = f.element.length;
+ f.element[i] = new Object();
+ f.element[i].name = name;
+ f.element[i].label = label;
+ f.element[i].type = "text";
+ f.element[i].value = "";
+ if (arguments.length > 2) {
+ f.element[i].type = arguments[2];
+ }
+ if (arguments.length > 3) {
+ f.element[i].value = arguments[3];
+ }
+}
/*
create a Form object with the defaults filled in, ready for display()
@@ -81,6 +99,7 @@ function FormObj(name, num_elements, num_submits)
f.submit = new Array(num_submits);
f.action = session_uri(request.REQUEST_URI);
f.class = "defaultform";
+ f.add = __addMethod;
for (i in f.element) {
f.element[i] = new Object();
f.element[i].type = "text";