[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Submitting 2 forms at once


Maybe someone can helo me:

I try to send two forms at the same time, then change the location.

This is done by copying the content of the first form into the second, 
then both forms shall be submitted -they have different ACTION.

After submission, the Visitor should be directed to another page.
I tried:
______________________  SNIPPLE _______________________________

var timeout = 3000;

var timeout2 = 10000;

var NewLocation = "respond.html";

function SendTwo()

        Obj = document._form.emailSenderName;
        Obj2 = document.form2.emailSenderName;
        Obj2.value = Obj.value;
        Obj = document._form.emailSenderAddress;
        Obj2 = document.form2.emailSenderAddress;
        Obj2.value = Obj.value;
        Obj = document._form.emailBody;
        Obj2 = document.form2.emailBody;
        Obj2.value = Obj.value;
        TID1 = window.setTimeout("document.form2.submit();",timeout);
        TID2 = window.setTimeout("GoToResp();",timeout2);
        return true;
function GoToResp()
                var ref = window.location.href;
                var last = ref.lastIndexOf("/");
                ref = ref.substring(0,last);
                ref += "/" + NewLocation;
                window.location.href = ref;

______________________ SNAPPLE ___________________________

and it worked on my machine (with the files on my harddisk) - 
but when it was uploaded to thi Internet, it does not work always

Any idea? Any idea to do that without those stupid timeouts?
It does'nt send both forms if I don't use it.....

Thanks a lot for any help!

So long
Olaf Walkowiak, Suedeseestr.14, D-45145 Essen, Phone:+49-201-604594
si0015@aixrs1.hrz.uni-essen.de			OlafWal@aol.com
URL:http://www.bikeconn.de/com/bikeconn/hotel/olaf	(Homepage)
URL:http://www.bikeconn.de/com/bikeconn/hotel/olaf/java (JavaScript)
Request PGP public key by E-Mail
PGP fingerprint: 55 BF 58 7A E9 DC FF 28 33 31 A6 B8 FB A1 28 A6

For help about the list, please send a message to 'majordomo@obscure.org'
with the message body 'help'. To unsubscribe, send a message to
'majordomo@obscure.org' with the message body 'unsubscribe javascript'.
List archives and pointer to FAQ: http://www.obscure.org/javascript/