Build Your Own Counter Widgets
- 0
- Add a Comment
Roll your own widgets! It’s true, Christian Heilmann shows his readers exactly how they can create widgets of their very own using Javascript and HTML.
(Quote)
“One such recurring requirement of forms is the numeric field. Many forms include at least one field that can accept numeric values that occur within a certain range and are rounded to whole numbers (i.e. no decimals are allowed).
Rich-client applications have such a widget — a text field followed by ‘up’ and ‘down’ arrows that allow users to increase or decrease the field’s value. VB.NET calls this widget NumericUpDown.
To provide this functionality in plain HTML, we could use a drop-down list that contained all the possible values as options. This solution has several drawbacks, though:
* If you need the user to choose from a wide range of numbers, the drop-down list can become very long. Users may have to scroll through the list and spend a lot of time to reach the value they want.
* You need a huge amount of markup to generate a drop-down.”
