Use of standard links within forms for the appearance. This can be done
by using the form attribute ACTION to set a URL to jump to a page, and the
link HREF to call the java routine e.g.
"javascript:document.evaluation.submit();" class="normaddr"
Forms have items; any item (displayed or not) that has both a name and a
value, will have that encoded and sent as:
url?name=val1&name2=val2&name3=val3+word3b....
Buttons (type "submit") will also have their value sent iff they have both
name and value defined. (Their value is the button label, so you may see
buttons with value but no name.)
================
Preserving state
Beyond the simple cases, the big issue is how to preserve state in a
multi-step interaction. Alternative methods are:
a)
b) Cookies
c) Designing the forms to resubmit every time values estabished in earlier
iterative interactions with the form.
Script demoforms.php illustrates some of this.
d) Java, setting less obvious attributes of DOM items.
To preserve state in a multi-step interaction, the server/author may put out
pages with hidden variables set to values gathered from the user earlier
(e.g. by a related page ...), so they are re-sent by the form.
Cookies are an alternative. Their contents are mainly name=value pairs.
Main use: maintaining state, preventing repetitive logins, shopping baskets
etc. But also used for logging users' access to a site across time.
If you have multiple forms on one page, then each user submit might be to a
diff. form; and maintaining hidden vars could preserve the state of one form
when the other form submits.
========== ========== ========== ==========
B] DOC. ON STD. HTML/BROWSER INSTANTIATION OF FORMs.
----- ----- ----- ----- -----
FORMs' basic HTML behaviour
Returns a value for the var. associated with every element on the form, except:
Buttons: only at most the one clicked.
RadioBtns: at most the one selected [is possible to have none selected]
Checkboxes: only if checked on.
So state is maintained by being repeated on every FORM invocation;
and type=hidden-s can return extra var-value pairs.
Adding an HTML field corresponding to a pre-existing java
field CAN set the field in the Java DOM object.
E.g setting in
Note that this is esp. useful for CSS which often corresponds to fields in the
java object.
Nested forms seem to be merged: submitting either returns all the elements
from both.
==========
FORMs' TYPES SYNTAX: the std. elements ("types") provided in HTML
inside (or outside?) a form, draws a box.