Skip to Main Content
Adobe® Dreamweaver® CS4 Bible
book

Adobe® Dreamweaver® CS4 Bible

by Joseph Lowery
March 2009
Beginner to intermediate content levelBeginner to intermediate
1321 pages
46h 24m
English
Wiley
Content preview from Adobe® Dreamweaver® CS4 Bible
458
Part III
Adding Advanced Design Features
Forms and AP elements
When you’re mixing forms and AP elements, follow only one rule: Always put the form completely
inside the AP element. If you place the AP element within the form, all form elements after the AP
element tags are ignored. With the form completely enclosed in the AP element, the form can safely
be positioned anywhere on the page and all form elements still remain completely active.
Although this rule means that you can’t split one form onto separate AP elements, you can set up
multiple forms on multiple AP elements—and still have them all communicate to one final CGI or
other program. This technique uses JavaScript to send the user-input values in the separate forms to
hidden fields in the form with the Submit button. Suppose, for example, that you have three sepa-
rate forms gathering information in three separate AP elements on a Web page. Call them formA,
formB, and formC on apDiv1, apDiv2, and apDiv3, respectively. When the Submit button in formC
on layer3 is selected, a JavaScript function is first called by means of an
onClick event in the but-
ton’s
<input> tag. The function, in part, looks like the following:
function gatherData() {
document.formC.hidden1.value = document.formA.text1.value
document.formC.hidden2.value = document.formB.text2.value
}
Notice how every value from the various forms is sent to a hidden ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Adobe® Dreamweaver® CS5 Bible

Adobe® Dreamweaver® CS5 Bible

Joseph W. Lowery
Dreamweaver® CS3 Bible

Dreamweaver® CS3 Bible

Joseph W. Lowery

Publisher Resources

ISBN: 9780470382523Purchase book