Hi,
>From what I know, there are 2 ways of doing it. The main point is that only
one form can be submitted at one time so if you have a bunch of forms, there
is really not an easy way to submit all those values in one shot...
(1) via javascript variables (or arrays) or
var formFields = ['fieldName1','fieldName2', 'fieldName3', ... ];
var formValues = ['fieldValue1','fieldValue2', 'fieldValue3', ... ];
(2) using a separate form with all the fields as hidden... you have to map
out your select boxes, checkboxes though so that you can set the values in
the hidden fields properly...
I would probably do #2.
Whichever method you choose, the submit button (on any form) would call a
javascript function that will aggregate all the values of the different
forms and map them to the hidden form Alternately, you can also try to
have a javascript function loop through all the forms
(document.forms.length) and loop through each element in each of the forms
and then do the map that way. This is probably overkill.
===================
<html>
<head>
<script language="Javascript">
function submitForm() {
document.formAll.form1_field1.value = document.form1.form1_field1.value;
document.formAll.form1_field2.value = document.form1.form1_field2.value;
document.formAll.form2_field1.value = document.form2.form2_field1.value;
document.formAll.form2_field2.value = document.form2.form2_field2.value;
document.formAll.submit();
}
</script>
</head>
<body>
<!--- 1st form --->
<form name="form1" onSubmit="submitForm();">
<input type="text" name="form1_field1">
<input type="text" name="form1_field2">
</form>
<!--- 2nd form --->
<form name="form2" onSubmit="submitForm()">
<input type="text" name="form2_field1">
<input type="text" name="form2_field2">
</form>
<!--- Giant hidden form --->
<form name="formAll" action="file.htm" method="post">
<input type="hidden" name="form1_field1">
<input type="hidden" name="form1_field2">
<input type="hidden" name="form2_field1">
<input type="hidden" name="form2_field2">
</form>
</body>
</html>
===================
Anyway, the above is the basic way I think it would work... if you need to
figure out how the layers talk to each other you can just do a call like
this:
obj.doc.form1.form1_field1.value
obj2.doc.form2.form2_field1.value
("obj" and "obj2" are what you used to create the widget or dynlayer --> obj
= new DynLayer(); and obj2 = newDynlayer();)
and then you proceed on doing the mapping like so above... substituting
"document." with "obj.doc."
document.formAll.form1_field1.value = obj.doc.form1_field1.value;
document.formAll.form1_field2.value = obj.doc.form1.form1_field2.value;
document.formAll.form2_field1.value = obj2.doc.form2.form2_field1.value;
document.formAll.form2_field2.value = obj2.doc.form2.form2_field2.value;
=================
Hope this helps..
Chris
----- Original Message -----
From: "rlb" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, January 03, 2001 9:27 PM
Subject: [Dynapi-Help] I've Been watching the FORM help posts.
> I think I can word my question correctly now,
>
> How would I go about aggregating a large FORM for submittal (from the
> main document ?), that has pieces of the FORM elements spread out over
> a set of separate layers (in separate FORMs, found this out from
> reading the posts), and each layer would/could contain a FORM SUBMIT
> button that would read all the other layers FORM elements before
> submitting?
>
> I thought about using a COOKIE to store the info. but this seemed like
> overkill, or is it?
>
> I know this is a basic question, but I'm at a loss as to how the layers
> communicate between each other with javascript. Is there a hint in the
> recent posts about "Help on forms"?
>
> I just need something to get me started . . . .even if it's to point me
> at what to look up while I'm currently reading the chapter in my
> O'reilly book about the Document Object.
>
> Thanks
>
> --
> -+-+-+-+-+-
>
>
> bobb
>
> http://64.33.167.222/
>
>
>
> _______________________________________________
> Dynapi-Help mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/mailman/listinfo/dynapi-help
>
_______________________________________________
Dynapi-Help mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/mailman/listinfo/dynapi-help