Have you ever wanted to offer a web user a keywords field (e.g. a combobox), but allow the user to enter a value not in the list? Here is a way to do it.
Code
Suppose your keywords field is called categories and it is a combobox field. Place a button next to the field labelled "Unlisted value", for instance and enter the following code:
var newValue = prompt("Enter unlisted value","");
if(typeof newValue == "string") {
var categories = this.form.Categories;
categories.options[categories.length] =
new Option(newValue, newValue, true, true)
}
(Note this only works on the web, not in the Notes client.)