quisp: textarea form fields

quick server pages
| Manual page for textarea(form)

## Textarea form fields

HTML form `<TEXTAREA>`s allow an unlimited amount of text to be entered by a user. The text can contain embedded newlines and/or contain very long lines without line breaks. Thus, `<TEXTAREA>` input usually cannot be stored, displayed, retrieved, or manipulated in the same way as other tabular data fields.``

QUISP provides a facility for capturing `<TEXTAREA>` input in the target page and saving it to a file or displaying it.`` There is also provision for displaying the saved text at a later time, by reference.``

We refer to `<TEXTAREA>` input as a "textchunk".`` QUISP stores textchunks in files located in the `./textchunks` directory. The developer manages the naming and organization of textchunks within this directory.`` The developer must create the necessary `textchunks` subdirectories manually, in advance.``

See these examples in the live demo on sourceforge:

- capturing input from a textarea field
- database example with data entry/update

## #showtext

Display a textchunk. `#showtext` may be used in any sort of page. If used in a form target page, submitted `<TEXTAREA>` input can be displayed.`` Otherwise a saved textchunk is loaded from file and displayed (it's OK if the textchunk doesn't exist).`` If users have embedded HTML constructs in their `<TEXTAREA>` input these constructs will generally be interpreted by the browser.``

Usage: `#showtext` name`[addbr] [evalvars]`

name is either the name of a submitted `<TEXTAREA>` field, or a filename relative to `./textchunks`.

addbr may be specified if you wish for embedded newlines to be displayed as HTML `<BR>` line breaks.``

evalvars may be specified if the text could contain quisp @variables and these should be evaluated.

Target page example: `#showtext remarks addbr`

Other page example: `#showtext people_contact_remarks/903`

Another example

          <textarea name=remarks rows=4 cols=40>
            #showtext  changelog/@id
          #+ </textarea>

If (because of code indentation) the closing </textarea> tag has leading whitespace, a `#+` should be used to prevent spurious whitespace within the text area (as shown above).``

## #savetext

Save submitted `<TEXTAREA>` input to a file. Used only in form target pages.``

Usage:

       #cgitextvar textareaname
       ..
       #savetext  textareaname  filename

textareaname is the name of a submitted `<TEXTAREA>` field.``

filename is the filename, relative to `./textchunks`, where the text will be stored.`` This name must be built by the application. It's recommended that this name be built using the table, field, key value, etc. that the text is associated with (this allows linkage back to the database when textchunks area searched).`` Required subdirectories must be created by the developer in advance.``

If no text was entered into the `<TEXTAREA>`, nothing will be saved.`` The application can detect whether text was saved or not by calling the `$textsaved()` function.``

## $textsaved()

This function returns `1` if the previous `#savetext` saved any text to file.`` Otherwise it returns `""`.
quick server pages
Copyright Steve Grubb

Markup created by unroff 1.0, `` `` April 13, 2004.