cfslider

Description

Used inside cfform, cfslider lets you place a slider control in a ColdFusion form. A slider control is like a sliding volume control. The slider groove is the area over which the slider moves.

Category

Forms tags

Syntax


<cfslider name = "name"

  label = "text"

  refreshLabel = "Yes" or "No"

  img = "filename"

  imgStyle = "style"

  range = "min_value, max_value"

  scale = "uinteger"

  value = "integer"

  onValidate = "script_name"

  message = "text"

  onError = "text"

  height = "integer"

  width = "integer"

  vSpace = "integer"

  hSpace = "integer"

  align = "alignment"

  tickMarkMajor = "Yes" or "No"

  tickMarkMinor = "Yes" or "No"

  tickMarkImages = "URL1, URL2, URLn"

  tickMarkLabels = "Yes" or "No" or or "list"

  lookAndFeel = "motif" or "windows" or "metal"

  vertical = "Yes" or "No"

  grooveColor = "color"

  bgColor = "color"

  textColor = "color"

  font = "font_name"

  fontSize = "integer"

  italic = "Yes" or "No"

  bold = "Yes" or "No"

  notSupported = "text"> 

See also

cfapplet, cfinput, cfform, cfselect, cfgrid, cfgridcolumn, cftextinput, cfgridrow, cftree, cfgridupdate, cftreeitem

Attributes

Attribute
Description
name
Required. A name for the cfslider control.
label
Optional. A label that displays with the slider control, for example:

label = "Volume %value%" 

You can use %value% to reference the slider value anywhere within the text. If % is omitted, the slider value displays immediately following the label.
refreshLabel
Optional. Yes or No. If Yes, the label is not refreshed when the slider is moved. Default is Yes.
img
This attribute has been deprecated and is non-functional.
imgStyle
This attribute has been deprecated and is non-functional.
range
Optional. The values of the left and right slider range. The slider value displays as the slider is moved.
Separate values by a comma; for example:

range = "1,100" 

Default is "0,100". Valid only for numeric data.
scale
Optional. Unsigned integer. Defines the slider scale within the value of range. For example, if range = "0,1000" and scale = "100", the incremental values for the slider are 0, 100, 200, 300, and so on.
Signed and unsigned integers in ColdFusion are in the range -2,147,483,648 to 2,147,483,647.
value
Optional. The starting slider setting. Must be within the values specified in range. Defaults to the minimum value specified in range.
onValidate
Optional. The name of a valid JavaScript function used to validate user input; in this case, a change to the default slider value.
message
Optional. Message text to appear if validation fails.
onError
Optional. The name of a valid JavaScript function to execute in the event of a failed validation.
height
Optional. Height of the slider control, in pixels.
width
Optional. Width of the slider control, in pixels.
vSpace
Optional. Vertical margin spacing above and below slider control, in pixels.
hSpace
Optional. Horizontal margin spacing to the left and right of slider control, in pixels.
align
Optional. Alignment value. Valid entries are:
  • top
  • left
  • bottom
  • baseline
  • texttop
  • absbottom
  • middle
  • absmiddle
  • right
tickMarkMajor
Optional. Yes to render major tickmarks in the slider scale. No for no major tickmarks. Default is No.
Major tick marks are the marks that appear at the intervals specified by the Scale attribute.
tickMarkMinor
Optional. Yes to render minor tickmarks in the slider scale. No for no minor tickmarks. The default is No.
Minor tickmarks are the (usually smaller) marks that appear between the major tickmarks.
tickMarkImages
Optional. A comma-separated list of URLs specifying images to use in the slider tickmark scale.
If you do not specify enough values, the last value is repeated for all remaining tickmarks. If you specify too many values, the extra values are ignored.
tickMarkLabels
Optional. Accepts one of these types of entries:
  • yes for numeric tickmarks based on the value of the range and scale attributes.
  • no prevents any label text from displaying (default).
  • Comma-separated list of strings for tickmark labels; for example:

  tickMarkLabels = "ten, twenty, thirty, forty, fifty" 

If you do not specify enough values, the last value is repeated for all remaining tickmarks. If you specify too many values, the extra values are ignored.

lookAndFeel
Optional. A stylistic choice for the slider. Enter one of the following:
  • motif    Renders the slider using Motif style.
  • windows    (default) Renders the slider using Windows style.
  • metal    Renders the slider using Java Swing style.
If your platform cannot support your style choice, the tag defaults to using the platform's default style.
vertical
Optional. Yes renders the slider in the browser vertically. No renders the slider horizontally (the default).
If you enter vertical = "yes", you must adjust the width and height attributes. ColdFusion doesn't automatically swap width and height values. Default is No.
grooveColor
This attribute has been deprecated and is non-functional.
bgColor
Optional. Background color of slider label. See textColor for color options.
textColor
Optional. Slider label text color. Valid entries are: black, magenta, cyan, orange, darkgray, pink, gray, white, lightgray, yellow. A hex value can be entered in the form:

textColor = "##xxxxxx" 

Where x is 0-9 or A-F. use either two pound signs or no pound signs.
font
Optional. Font name for label text.
fontSize
Optional. Font size for label text measured in points.
italic
Optional. Yes for italicized label text, No for normal text. Default is No.
bold
Optional. Enter Yes for bold label text, No for medium text. Default is No.
notSupported
Optional. The text to display if a page containing a Java applet-based cfform control is opened by a browser that does not support Java or has Java support disabled. For example:

notSupported = "<B> Browser must support Java to 

view ColdFusion Java Applets</B>" 

By default, if no message is specified, the following message displays:

<B>Browser must support Java to <BR> 

view ColdFusion Java Applets!</B> 

Usage

cfslider requires the client to download a Java applet. This takes time; therefore, using cfslider may be slightly slower than using an HTML form element to retrieve or display the same information. Browsers must be Java-enabled for cfslider to work properly.


Note

The img, imgStyle, and grooveColor attributes are deprecated in ColdFusion 5 and are non-functional. Code that uses these attributes does not throw errors; it is ignored by ColdFusion.


Example

<!--- This example shows how to use cfslider within cfform --->

<html>



<head>

<title>

  cfslider Example

</title>

</head>



<body bgcolor = silver>



<h3>cfslider Example</h3>

<p>cfslider, used within a cfform, can provide

additional functionality to Java-enabled browsers.



<p>Try moving the slider back and forth to see the

real-time value change. Then, submit the form to show

how cfslider passes its value on to a new CF template.



<cfif isdefined("form.mySlider") is true>

<h3>You slid to a value of <cfoutput>#mySlider#</cfoutput></h3>



Try again!

</cfif>



<cfform action = "cfslider.cfm" method = "POST" enablecab = "Yes">



1 <cfslider name = "mySlider" value = "12" label = "Actual Slider Value "

  range = "1,100" align = "BASELINE" 

  message = "Slide the bar to get a value between 1 and 100" height = "20"

  width = "150" font = "Verdana" bgColor = "Silver" grooveColor = "Lime"

  bold = "No" italic = "Yes" refreshLabel = "Yes"> 100



<p><input type = "Submit" name = "" value = "Show the Result">

</cfform>



</body>

</html>



Banner.Novgorod.Ru