Click to See Complete Forum and Search --> : Problems with mailto


il_betto
04-26-2007, 07:23 AM
Hi !!
I have a problem:
- if one push Sub1 it 'll be opened correctly email to nome1
- if one push Sub2 it 'll be opened correctly email to nome2

- if one push again Sub1 it 'll be opened again email to nome2 and NOT to nome1. Why ??

<%@ Language=VBScript %>
<% Option Explicit %>
<html>
<head>
<script language="Javascript">
function send() {
for (i=0; i<document.FrontPage_Form2.length; i++) {
FrontPage_Form2.elements[i].disabled=true; }
if (document.FrontPage_Form2.name.value != "") {
document.FrontPage_Form2.action='mailto:nome1@libero.it?subject=Bye&body=ciao2'; }
if (document.FrontPage_Form2.surname.value != "") {
document.FrontPage_Form2.action='mailto:nome2@libe ro.it?subject=Bye&body=ciao3'; }
document.FrontPage_Form2.submit();
document.FrontPage_Form2.action="pagina11.asp";
for (i=0; i<document.FrontPage_Form2.length; i++) {
FrontPage_Form2.elements[i].disabled=false; }
}
</script>
</head>
<body>
<form method="post" enctype="text/plain" name="FrontPage_Form2" action="pagina11.asp">
<input type="text" name="name" size=20><br>
<input type="text" name="surname" size=20><br>
<input type="text" name="city" size=20><br>
<input type="button" value="Sub1" onClick="send()">
<input type="button" value="Sub2" onClick="send()">
<input type="submit" value="Submit" name="Submit">
</form>
</body>
</html>

Thanks a lot in advance !!!!

LeeU
04-26-2007, 09:44 AM
Please don't double post. The other one has been removed.