behavior: form

Standard behavior of the <form> element. Form is a “submitable” container. When it receives FORM_SUBMIT event from <button type=“submit”> it sends collection of name/value pairs to the server on url defined by action attribute.

Elements

that have this behavior applied by default (see master style sheet):

  • <form>

Attributes

that this behavior knows about:

  • action=“url” - url of the cgi module (e.g. PHP or ASP page) on the server that will process values of input elements contained on the form.
  • target=“frame-name” - optional, name of the <frame> that will receive response from the server.
  • method=“get” | “post” - type of http request to be used for submission.
  • enctype=“application/x-www-form-urlencoded” | “multipart/form-data” - type of data encoding to use for submission. Use “multipart/form-data” if the form contains <input type=file> elements.

Value

Value of the form element is a collection of name/value pairs represented as VALUE (or json::value) of type T_MAP.

Events

When the behavior:form receives BUTTON_CLICK event from <button type=submit> or <button type=reset> it generates:

  • FORM_SUBMIT event - the form is about to submit form values. The values to send are in BEHAVIOR_EVENT_PARAMS::data field.
  • FORM_RESET event - the form is about to restore initial values of input fields. The values that will be set are in BEHAVIOR_EVENT_PARAMS::data field.

To discard submission or clearance of the form the application shall “consume” the event - return TRUE from the event handler.

h-smile/built-in-behaviors/form.txt · Last modified: 2010/07/21 23:08 by andrew
chimeric.de = chi`s home Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0