SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 758 | Next

Joseph W. Lowery

"Dreamweaver CS3 Bible"


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 separate 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 button??™s 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 field in formC, the form with the Submit
button. Now, when the form is submitted, all the hidden information gathered from the various forms is
submitted along with formC??™s own information.
The code for this separate-forms approach, as shown in the preceding listing, works in Internet
Explorer. Netscape 4.


Pages:
746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770