summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Metzler2013-06-04 17:31:59 (GMT)
committer David Metzler2013-06-04 17:31:59 (GMT)
commit5b4d8740ddd0dc21a3fb70fb7d5ab10819662a7f (patch)
treeef3255d5b4b7375aded8463135864ecc8cbd9393
parent45178804a134ed62bf6280ccc70e80689b294976 (diff)
Added propmpting for select fields so that they don't always default.
-rwxr-xr-xforena.module5
1 files changed, 5 insertions, 0 deletions
diff --git a/forena.module b/forena.module
index 97b1f5b..8e60422 100755
--- a/forena.module
+++ b/forena.module
@@ -633,6 +633,11 @@ function forena_parameter_form($formid, &$form_state, $parameters, $attributes=
//onto the array. options will cause an error for
//textfield elements.
if ($list || $type == 'select' || $type =='radios') {
+ if ($add_null) {
+ $prompt = @$options['prompt'];
+ if (!$prompt) $prompt = $required ? '-select-' : '-none-';
+ $form['params'][$id]['#empty_option'] = $prompt ;
+ }
$form['params'][$id]['#options'] = $list;
$form['params'][$id]['#multiple'] = $multiselect;
}