From 50dcd7a5726292a4dcabd69994fcf67aaf616a09 Mon Sep 17 00:00:00 2001 From: mdipierro Date: Mon, 3 Jun 2013 17:48:13 -0500 Subject: [PATCH] conditional fields --- VERSION | 2 +- applications/admin/static/js/web2py.js | 24 +++++++++++++++++++ applications/examples/static/js/web2py.js | 24 +++++++++++++++++++ applications/welcome/static/js/web2py.js | 24 +++++++++++++++++++ gluon/sqlhtml.py | 28 ++++++++++++++++++++++- 5 files changed, 100 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index f1bb104b..455f47c0 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.4.7-stable+timestamp.2013.06.01.18.23.56 +Version 2.4.7-stable+timestamp.2013.06.03.17.47.22 diff --git a/applications/admin/static/js/web2py.js b/applications/admin/static/js/web2py.js index f9fce21d..c4d5ee13 100644 --- a/applications/admin/static/js/web2py.js +++ b/applications/admin/static/js/web2py.js @@ -78,6 +78,7 @@ jQuery(function() { if(flash.html()) flash.append('×').slideDown(); web2py_ajax_init(document); web2py_event_handlers(); + web2py_show_if(); }); function web2py_trap_form(action,target) { @@ -216,3 +217,26 @@ function web2py_validate_entropy(myfield, req_entropy) { if(!myfield.hasClass('entropy_check')) myfield.on('keyup', validator).on('keydown', validator).addClass('entropy_check'); } +function web2py_show_if() { + var triggers = {}; + var show_if = function() { + var t = jQuery(this); + var id = t.attr('id'); + t.attr('value',t.val()); + for(var k=0; k×').slideDown(); web2py_ajax_init(document); web2py_event_handlers(); + web2py_show_if(); }); function web2py_trap_form(action,target) { @@ -216,3 +217,26 @@ function web2py_validate_entropy(myfield, req_entropy) { if(!myfield.hasClass('entropy_check')) myfield.on('keyup', validator).on('keydown', validator).addClass('entropy_check'); } +function web2py_show_if() { + var triggers = {}; + var show_if = function() { + var t = jQuery(this); + var id = t.attr('id'); + t.attr('value',t.val()); + for(var k=0; k×').slideDown(); web2py_ajax_init(document); web2py_event_handlers(); + web2py_show_if(); }); function web2py_trap_form(action,target) { @@ -216,3 +217,26 @@ function web2py_validate_entropy(myfield, req_entropy) { if(!myfield.hasClass('entropy_check')) myfield.on('keyup', validator).on('keydown', validator).addClass('entropy_check'); } +function web2py_show_if() { + var triggers = {}; + var show_if = function() { + var t = jQuery(this); + var id = t.attr('id'); + t.attr('value',t.val()); + for(var k=0; k