Newton FORM: Introduction; slider, AZ, recognition/keyboards

This introduces how to use other Newton prototypes and custom recognizers/keyboards within an HTML form. The form objects appear as regular TEXT fields within other browsers and 2.x objects appear as TEXT on 1.x Newtons. This uses the optional VALUE_TYPE attribute for a normal INPUT TEXT field.

In the future, I may add support for other built-in prototypes. Suggestions?

Slider

This can be used to select a numeric value. Since a slider does not have a label, begin it with <P> to avoid losing the preceding string. This slider defaults to a range of 0-100 and value of 0 (on Newton); height defaults to 10. This uses a "slider" prototype defined earlier in META. The :getData and :setData methods are added by Newt's Cape to enable the prototype object to use/store form values.

The second slider example shows how to include other attributes: a taller height, initial value, and min and max values (this assumes some knowledge of the protoSlider API (see NTK docs) and appropriate mapping of HTML minValue and maxValue attributes to object slots).

A-to-Z picker

This picker can select a location within a picture (similar to a client-side image map) -- here, the location is mapped to a single letter value (A-Z). Since a pictIndexer does not have a label, begin it with <P> to avoid losing the preceding string.

Here is a A-to-Z picker with initial value of "S" and HEIGHT of 8 (instead of 10):

recognition, keyboards

The default character recognizer for a TEXT field is "anything" and when you double-tap the field (on systems with no keyboard), a full alphanumeric keyboard normally pops up.

When you specify a VALUE_TYPE that begins with DATE, INT (or NUM), PHONE (or FAX), NAME, ADDRESS, COUNTRY, CITY, STATE or PROVINCE, this provides information that can

  1. improve handwriting recognition since it biases which characters and possibly which words (based on dictionaries) are expected
  2. provide a special keyboard (for DATE, TIME, INT, NUM, PHONE, FAX)

First, Newt's Cape checks if there is a more specific definition available that matches the entire VALUE_TYPE. For example, in this document, INTSLIDER is defined and should work on all Newtons. If the definition were not available (or user had disabled NewtonScript compile), the field would appear as a normal TEXT field, but it would offer improvements for recognizing and typing numbers. The other example files discussed earlier follow this convention -- the definitions start with INT, DATE, TIME, PHONE, FAX, NAME, ADDRESS, COUNTRY, CITY, STATE or PROVINCE -- so will provide either a type specific picker or improved recognition (and possibly keyboard).

date

time

number

phone

fax

name

address

country

city

state

province


This document (in all its formats) is © 1997-2007. Steve Weyer. All Rights Reserved Worldwide. You are free to incorporate this into your own documents, but I would appreciate an acknowledgement of Newt's Cape and the example.

Last updated: Dec 2000