summaryrefslogtreecommitdiffstats
path: root/usr/local
diff options
context:
space:
mode:
authorErik Fonnesbeck <efonnes@gmail.com>2010-11-09 03:02:54 -0700
committerErik Fonnesbeck <efonnes@gmail.com>2010-11-09 03:02:54 -0700
commit5d27a3dc148ed4ad8228605b2547e1115d66f86b (patch)
treec18550eeba0bdfd3926859c961bfdcab95aa82fb /usr/local
parent5868547083d34ae6e78d3584dd5f06d3bbe79873 (diff)
downloadpfsense-5d27a3dc148ed4ad8228605b2547e1115d66f86b.zip
pfsense-5d27a3dc148ed4ad8228605b2547e1115d66f86b.tar.gz
Add a function type to the field types allowed, to allow more field types without directly adding all of them to row helper.
Diffstat (limited to 'usr/local')
-rwxr-xr-xusr/local/www/javascript/row_helper.js4
-rwxr-xr-xusr/local/www/javascript/row_helper_dynamic.js4
2 files changed, 6 insertions, 2 deletions
diff --git a/usr/local/www/javascript/row_helper.js b/usr/local/www/javascript/row_helper.js
index 68a00bd..dc8a282 100755
--- a/usr/local/www/javascript/row_helper.js
+++ b/usr/local/www/javascript/row_helper.js
@@ -24,7 +24,9 @@ var addRowTo = (function() {
tr = d.createElement("tr");
for (i = 0; i < field_counter_js; i++) {
td = d.createElement("td");
- if(rowtype[i] == 'textbox') {
+ if(typeof(rowtype[i]) == 'function') {
+ td.innerHTML="<INPUT type='hidden' value='" + totalrows +"' name='" + rowname[i] + "_row-" + totalrows + "'></input>" + rowtype[i](rowname[i], rowsize[i], totalrows) + " ";
+ } else if(rowtype[i] == 'textbox') {
td.innerHTML="<INPUT type='hidden' value='" + totalrows +"' name='" + rowname[i] + "_row-" + totalrows + "'></input><input size='" + rowsize[i] + "' class='formfld unknown' name='" + rowname[i] + totalrows + "' id='" + rowname[i] + totalrows + "'></input> ";
} else if(rowtype[i] == 'password') {
td.innerHTML="<INPUT type='hidden' value='" + totalrows +"' name='" + rowname[i] + "_row-" + totalrows + "'></input><input type='password' size='" + rowsize[i] + "' class='formfld pwd' name='" + rowname[i] + totalrows + "' id='" + rowname[i] + totalrows + "'></input> ";
diff --git a/usr/local/www/javascript/row_helper_dynamic.js b/usr/local/www/javascript/row_helper_dynamic.js
index 210e416..bef6120 100755
--- a/usr/local/www/javascript/row_helper_dynamic.js
+++ b/usr/local/www/javascript/row_helper_dynamic.js
@@ -27,7 +27,9 @@ var addRowTo = (function() {
objectSize = rowsize[i];
for (i = 0; i < field_counter_js; i++) {
td = d.createElement("td");
- if(rowtype[i] == 'textbox') {
+ if(typeof(rowtype[i]) == 'function') {
+ td.innerHTML="<INPUT type='hidden' value='" + totalrows +"' name='" + rowname[i] + "_row-" + totalrows + "'></input>" + rowtype[i](rowname[i], objectSize, totalrows) + " ";
+ } else if(rowtype[i] == 'textbox') {
td.innerHTML="<INPUT type='hidden' value='" + totalrows +"' name='" + rowname[i] + "_row-" + totalrows + "'></input><input size='" + objectSize + "' name='" + rowname[i] + totalrows + "' id='" + rowname[i] + totalrows + "'></input> ";
} else if(rowtype[i] == 'select') {
td.innerHTML="<INPUT type='hidden' value='" + totalrows +"' name='" + rowname[i] + "_row-" + totalrows + "'></input><select name='" + rowname[i] + totalrows + "' id='" + rowname[i] + totalrows + "'>" + newrow[i] + "</select> ";
OpenPOWER on IntegriCloud