Commit 1e2d200b authored by Nigel McNie's avatar Nigel McNie Committed by Nigel McNie
Browse files

Provide JS for getting the radio value when doing an AJAX request

parent 5e405159
...@@ -79,6 +79,17 @@ function form_get_value_date($element, Form $form) { ...@@ -79,6 +79,17 @@ function form_get_value_date($element, Form $form) {
return $time; return $time;
} }
function form_get_value_js_date($element, Form $form) {
$formname = $form->get_name();
$name = $element['name'];
return <<<EOF
data['{$name}_year'] = document.forms['$formname'].elements['{$name}_year'].value;
data['{$name}_month'] = document.forms['$formname'].elements['{$name}_month'].value;
data['{$name}_day'] = document.forms['$formname'].elements['{$name}_day'].value;
EOF;
}
/** helper: used when rendering the element, to get the value for it */ /** helper: used when rendering the element, to get the value for it */
function form_render_select_get_value($timeperiod, $min, $max, $element, Form $form) { function form_render_select_get_value($timeperiod, $min, $max, $element, Form $form) {
static $lookup = array( static $lookup = array(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment