59233

Yes or no toggle or slider

Question:

I am trying to find a slider or a toggle for my application that allows the user to select yes or no and its harder then i thought to track one down...

I found this <a href="http://jqueryui.com/demos/slider/#rangemax" rel="nofollow">slider</a> but its 1 or 2 numeric and not yes or no text...any suggestions

Answer1:

we could edit it to have something like this,

$(function() { $("#slider-range-max").slider({ range: "max", min: 0, max: 1, value: 0, slide: function(event, ui) { $("#amount").val(ui.value?'Yes':'No'); } }); $("#amount").val($("#slider-range-max").slider("value")?'Yes':'No'); });​

<a href="http://jsfiddle.net/nmLcw/" rel="nofollow">crazy demo</a>

Recommend

  • CSS Bundling and Internet Explorer's Limit
  • Function to check if jquery plugins are already initialized
  • ASP Net Core - Mixing External Identity Provider with Individual User Accounts for Audit Tracking
  • Change color of row programmatically in WatchKit
  • Plot a table with R
  • Price range slider for my website
  • How to edit css for jquery datepicker prev/next buttons?
  • addressing in assembler
  • Keep transition effect on 1 div from moving the div that follows?
  • Jquery Show & ScrollTop (or ScrollTo)
  • CSS: How to fix overlapping divs
  • Change navbar in bootstrap if user login
  • C# 4 and CLR Compatibility
  • Stitching 2 images (OpenCV)
  • Neo4j: Filter nodes based on aggregate function
  • Android Chronometer starts and stops but carries on counting when stopped
  • How to create a Unix-domain socket with specific access permissions
  • What is corresponding c++ data type to SQL numeric(18,0) data type?
  • How can I tell a form not to dispose a particular control when it closes?
  • Hash Code in SQL Server?
  • Possible to get mouse events fired when cursor is outside page?
  • Sending keystrokes/mouse clicks to a Java program with Autohotkey
  • Intel-64 and ia32 atomic operations acquire-release semantics and GCC 5+
  • Read text file that is not in the main package in a runnable jar
  • How to match http request and response using Jersey ContainerRequestFilter and ContainerResponseFilt
  • Different response to non-authenticated users and AJAX calls
  • MySQL WHERE-condition in procedure ignored
  • Knitr HTML Loop - Some HTML output, some R output
  • Large data - storage and query
  • ORA-29908: missing primary invocation for ancillary operator
  • Web-crawler for facebook in python
  • How to get next/previous record number?
  • trying to dynamically update Highchart column chart but series undefined
  • How do you join a server to an Active Directory (domain)?
  • How does Linux kernel interrupt the application?
  • How can I remove ASP.NET Designer.cs files?
  • python draw pie shapes with colour filled
  • Is there any way to bind data to data.frame by some index?
  • How can i traverse a binary tree from right to left in java?
  • java string with new operator and a literal