next up previous
Next: More examples
Up: The WOM language
Previous: Code inserts

Getting data from the user

When inside an OnSubmit or Behaviour code insert, it will often be necessary to get at data entered by the user, for example values typed into fields. We have already mentioned that TextField has a value attribute. All other user-input elements --- the other fields, menus --- have this also, and it can be used in the same way.

It is sometimes necessary to distinguish between the characters typed by the user and the corresponding Object Rexx value. For example, we may want the user to be able to select the menu option Scrap it!, but for this to be translated to the value 0 before going into our program. For this reason, many user-input elements also have a display attribute. In such cases, this will be the input actually typed or selected by the user, and the value component will be the result of converting this to its final representation.

Some user-input elements also have a dataOK attribute to indicate whether the data was in some way invalid. An IntegerField, for instance, will set this flag to false if the string typed into it is not a valid integer.

Jocelyn Ireson-Paine
Fri May 30 14:03:06 BST 1997