Class ::xowiki::formfield::range
::xowiki::formfield::range
create ... \
[ -CSSclass (default "form-range") ]
HTML5 range input field. The range input is rendered as a slider
by the actual browsers.
- Documented Parameters:
- min
- minimum value of the value range
- max
- maximum value of the value range
- step
- increment steps when moving the slider
- with_output
- add an output box with show the actual slider value
(requires JavaScript)
- output_prefix
- prepend string value to the actual slider value
in the output display
- output_suffix
- append string value to the actual slider value
in the output display
Defined in /var/www/openacs.org/packages/xowiki/tcl/form-field-procs.tclClass Relations
- class: ::xotcl::Class
![[i]](/resources/acs-subsite/ZoomIn16.gif)
- superclass: ::xowiki::formfield::FormField
![[i]](/resources/acs-subsite/ZoomIn16.gif)
::xotcl::Class create ::xowiki::formfield::range \
-superclass ::xowiki::formfield::FormField
Methods (to be applied on instances)
CSSclass (setter)
initialize (scripted)
:type range
set :widget_type text
max (setter)
min (setter)
output_prefix (setter)
output_suffix (setter)
render_input (scripted)
set atts [:get_attributes type id name value {CSSclass class} min max step value autofocus autocomplete formnovalidate multiple pattern placeholder readonly required]
if {[:is_disabled]} {lappend atts {*}"disabled 1"}
::html::input $atts {}
if {${:with_output}} {
set :for ${:id}
set :outputID ${:id}-output
:CSSclass_list_add CSSclass ${:name}
::html::output [:get_attributes for {outputID id} {CSSclass class}] {
::html::t "${:output_prefix}${:value}${:output_suffix}"
}
set output_value [subst {'${:output_prefix}' + event.srcElement.value + '${:output_suffix}'}]
template::add_event_listener -id ${:id} -event input -preventdefault=false -script "document.getElementById('${:outputID}').value = $output_value;"
}step (setter)
value (setter)
with_output (setter)