DOCUMENTATION ON HTML : [A] A) DOCforms contains basic HTML doc on
s; plus it is about client-side manipulation of forms, mainly to send queries to other servers from me. It is also about my php support for serverside forms: using php to process incoming queries, and using forms to elicit that input from users. B) DOCformsJAVA contains stuff on how to use java with forms. ========== ========== ========== ========== *A small introduction is near the end (in sec.5) of ~steve/demo.html *This is the main holder for doc. on forms. *demoforms.php is the big demo of my PHP enhanced use of forms. Jump down this page to find: A) Philosophy / basic underlying approach B) doc. on std HTML/browser instantiation of them. C) my php toolkit for forms. ========== ========== ========== ========== A] Philosophy / basic underlying approach ----- ----- ----- ----- ----- Forms seem to have basic facilities you might want to use, not necessarily for forms, for: *User input, and transfer to a server side script or program. *HTML appearances: buttons, menus, boxes for scrolled output, and input *A different web access method POST. *Hence, a way of transferring variable settings from (hidden) HTML settings to the server script/software Thus you can consider mixing them with the other standard mechanisms:
  • Use of "url?var1=value1&var2=value2" to send variable settings by URL. However this only works if the server software has explict code to parse these.
  • 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.
    draws it only big enough, not to RHmargin Should add a bit here on FORM input of files for upload. // BUTTON This gives a) more freedom with label text; b) disconnect label and returned value ========== FORMs' TYPES descrip: the std. elements ("types") provided in HTML Checkboxes: On/off: return value for var, or nothing. Checkboxes: return 0-N multiple values for a single var; if you give same var name to multiple checkboxes. ["Multiple": menu, always open, allows multiple return values to one var.] Radio btns: return 1 of N values for one var. (effectively an always open menu). Menu: Ditto. (popup scrolling menu). Buttons: only returns something if clicked. OR? Hidden: return a fixed var=value pair. Useful for separate web pages all calling a single script processor: hidden vars store the state about the one page. x.checked: java bool var for reading/setting cur. value x.defaultChecked: whether checked by default These 2 apply to radio and checkbox; and to