...

View Full Version : Html Form in a pop up window javascript



mbay
05-06-2004, 05:01 AM
I have created a form in a pop up window. Once the form is submitted, I would like the form to send the information to my email address at michel.bayard@videotron.ca and then go to a customized thank you page within the same pop up (thankyou.html). In the form action, I have it as my e-mail address, which works fine, but I cannot have the thank you page appear afterwards. If i change the action to the thank you page and change the method to get then the page will appear, but then it doesn't send the e-mail to my address. I am really not a coding person at all and don't know too much. Is there a script I can integrate that upon submission of form that it verifies the required fields and if all is correct sends it to my email address and then goes to the thank you page?

Any contribution would be greatly appreciated.

Thank you kindly in advance.

--

This part in in the "head" aspect of the html

<SCRIPT LANGUAGE="JavaScript">

image1 = new Image();
image1.src = "../img/closewindow_over.gif";

function checkrequired(which) {
var pass=true;
if (document.images) {
for (i=0;i<which.length;i++) {
var tempobj=which.elements[i];
if (tempobj.name.substring(0,8)=="required") {
if (((tempobj.type=="text"||tempobj.type=="textarea")&&
tempobj.value=='')||(tempobj.type.toString().charAt(0)=="s"&&
tempobj.selectedIndex==0)) {
pass=false;
break;
}
}
}
}

if (!pass) {
shortFieldName=tempobj.name.substring(8,30).toUpperCase();
window.open('../html/form_email_missing.html', 'newwin','width=256,height=110, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, directories=no, status=no, left=0,top=100,screenX=0,screenY=100');
return false;
}
else
return true;
}

</script>

In the form aspect I have this code:

form action="mailto:michel.bayard@videotron.ca" method="post" enctype="text/plain"

JPM
05-06-2004, 06:51 AM
the 'thankYou.html' could be opened with 'document.location = thankyou.html'

mbay
05-06-2004, 04:41 PM
Thank you for your reply!!!!

But where do I put this code? Is it in the script header, or onsubmit? I don't know where to put it!!!!

Thanks for your help!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum