PDA

View Full Version : Need help with form


lagulalupis
03-02-2009, 08:32 PM
Hello,

Im trying to make a form for our foundation.
Oly, it wont work.
I dont get the form in my mail.
And i prefer to send the form through the site and not through outlook.
Some people think it's an error.
Thnx !


<html>

<head>
<meta http-equiv="Content-Language" content="nl">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Adopteren</title>
<style type="text/css">
<!--
.style1 {
color: #FF0000;
font-weight: bold;
}
-->
</style>
<script type="text/JavaScript">
<!--
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_validateForm() { //v4.0
var i,p,q,nm,test,num,min,max,errors='',args=MM_valida teForm.arguments;
for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
if (val) { nm=val.name; if ((val=val.value)!="") {
if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
} else if (test!='R') { num = parseFloat(val);
if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
min=test.substring(8,p); max=test.substring(p+1);
if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
} if (errors) alert('The following error(s) occurred:\n'+errors);
document.MM_returnValue = (errors == '');
}
//-->
</script>
</head>

<body bgcolor="#ffffff">

<form action="mailto:info@lagulalupis.eu" method="post" enctype="text/plain" name="Adoptie" id="Adoptie"><br>
<input type="hidden" name="subject" value="Dier adopteren" />
<input type="hidden" name="check_email_address" value="yes" />
<input type="hidden" name="after_url" value="bedankt.htm" />



<strong>Dier adopteren</strong><br>
<br>
<table border="0" width="100%">
<tr>
<td width="233">Naam</td>
<td width="715"><input type="text" name="Naam" size="50"></td>
</tr>
<tr>
<td width="233">Adres</td>
<td><input type="text" name="Adres" size="50"></td>
</tr>
<tr>
<td width="233">Postcode</td>
<td><input type="text" name="Postcode" size="50"></td>
</tr>
<tr>
<td width="233">Plaats</td>
<td><input type="text" name="Plaats" size="50"></td>
</tr>
<tr>
<td width="233">Telefoonnr</td>
<td><input type="text" name="Telefoon" size="50"></td>
</tr>
<tr>
<td width="233">Emailadres</td>
<td><input type="text" name="Emailadres" size="50"></td>
</tr>
<tr>
<td width="233">&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td width="233">Naam adoptiedier</td>
<td><input type="text" name="Adoptiedier" size="50"></td>
</tr>
<tr>
<td width="233">Adoptiebijdrage</td>
<td><input type="text" name="Bijdrage" size="50"></td>
</tr>
<tr>
<td>Per Week/Maand/Kwartaal/Jaarlijks </td>
<td><input name="Hoevaak" type="text" id="Hoevaak" size="50"></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td width="233">Opmerkingen</td>
<td bgcolor="#FFFFFF"><textarea name="Opmerkingen" cols="40" rows="5" id="Opmerkingen"></textarea></td>
</tr>
<tr>
<td width="233">&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
<p>Uw bijdrage maakt een groot verschil.<br>
Dankzij u kunnen wij dieren in onze opvang een optimale verzorging geven.<br>
Namens ons allemaal, Bedankt !<br>
<br>
<span class="style1">LET OP ! </span><br>
Het formulier word via uw eigen mailprogramma verzonden. </p>
<p><input name="B1" type="submit" onClick="MM_validateForm('Naam','','R','Adres','','R','Post code','','R','Plaats','','R','Telefoon','','R','Em ailadres','','R','Adoptiedier','','R','Bijdrage',' ','R','Hoevaak','','R');return document.MM_returnValue" value="Verzenden">
<input type="reset" value="Invoer wissen" name="B2"></p>
</form>

</body>

</html>

Corrosive
03-02-2009, 08:57 PM
Hello,

Im trying to make a form for our foundation.
Oly, it wont work.
I dont get the form in my mail.
And i prefer to send the form through the site and not through outlook.
Some people think it's an error.
Thnx !


<html>

<head>
<meta http-equiv="Content-Language" content="nl">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Adopteren</title>
<style type="text/css">
<!--
.style1 {
color: #FF0000;
font-weight: bold;
}
-->
</style>
<script type="text/JavaScript">
<!--
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_validateForm() { //v4.0
var i,p,q,nm,test,num,min,max,errors='',args=MM_valida teForm.arguments;
for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
if (val) { nm=val.name; if ((val=val.value)!="") {
if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
} else if (test!='R') { num = parseFloat(val);
if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
min=test.substring(8,p); max=test.substring(p+1);
if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
} if (errors) alert('The following error(s) occurred:\n'+errors);
document.MM_returnValue = (errors == '');
}
//-->
</script>
</head>

<body bgcolor="#ffffff">

<form action="mailto:info@lagulalupis.eu" method="post" enctype="text/plain" name="Adoptie" id="Adoptie"><br>
<input type="hidden" name="subject" value="Dier adopteren" />
<input type="hidden" name="check_email_address" value="yes" />
<input type="hidden" name="after_url" value="bedankt.htm" />



<strong>Dier adopteren</strong><br>
<br>
<table border="0" width="100%">
<tr>
<td width="233">Naam</td>
<td width="715"><input type="text" name="Naam" size="50"></td>
</tr>
<tr>
<td width="233">Adres</td>
<td><input type="text" name="Adres" size="50"></td>
</tr>
<tr>
<td width="233">Postcode</td>
<td><input type="text" name="Postcode" size="50"></td>
</tr>
<tr>
<td width="233">Plaats</td>
<td><input type="text" name="Plaats" size="50"></td>
</tr>
<tr>
<td width="233">Telefoonnr</td>
<td><input type="text" name="Telefoon" size="50"></td>
</tr>
<tr>
<td width="233">Emailadres</td>
<td><input type="text" name="Emailadres" size="50"></td>
</tr>
<tr>
<td width="233">&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td width="233">Naam adoptiedier</td>
<td><input type="text" name="Adoptiedier" size="50"></td>
</tr>
<tr>
<td width="233">Adoptiebijdrage</td>
<td><input type="text" name="Bijdrage" size="50"></td>
</tr>
<tr>
<td>Per Week/Maand/Kwartaal/Jaarlijks </td>
<td><input name="Hoevaak" type="text" id="Hoevaak" size="50"></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td width="233">Opmerkingen</td>
<td bgcolor="#FFFFFF"><textarea name="Opmerkingen" cols="40" rows="5" id="Opmerkingen"></textarea></td>
</tr>
<tr>
<td width="233">&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
<p>Uw bijdrage maakt een groot verschil.<br>
Dankzij u kunnen wij dieren in onze opvang een optimale verzorging geven.<br>
Namens ons allemaal, Bedankt !<br>
<br>
<span class="style1">LET OP ! </span><br>
Het formulier word via uw eigen mailprogramma verzonden. </p>
<p><input name="B1" type="submit" onClick="MM_validateForm('Naam','','R','Adres','','R','Post code','','R','Plaats','','R','Telefoon','','R','Em ailadres','','R','Adoptiedier','','R','Bijdrage',' ','R','Hoevaak','','R');return document.MM_returnValue" value="Verzenden">
<input type="reset" value="Invoer wissen" name="B2"></p>
</form>

</body>

</html>



You need a mail handling script server-side to do this. Suggest you look at PHP options.

lagulalupis
03-02-2009, 09:04 PM
Tried that, cant seem to get anything to work...

edbr
03-03-2009, 01:05 AM
you just have a mailto as action for your form you must point the action to the mail handler .

Rob_Che
03-04-2009, 12:53 PM
Lagulalupis, have you seen the PHP Form tutorial on this site for sending mail ?

Rob

lagulalupis
03-04-2009, 01:09 PM
Yes i have now.
My problem is that i dont get how to make more choices in a from.
I need the questions i put in my form but how do i do this in php ?
I really got stuck tima after time

edbr
03-05-2009, 02:30 AM
post thecode of script you are using