Forums
This topic is locked
Retrived Data Via Email and Validating Forms
Posted 23 Dec 2004 22:34:33
1
has voted
23 Dec 2004 22:34:33 shannen chu posted:
Problem 1 (Retrieved Data Via Email)I'm using Dreamweaver 4 to create a subscribtion form and have successfully retrieved the data with the formmail scripts! But i have met another problems when i retrieved the data via email:
1)There is NO sender's name in the email, the space is blank
2)There is NO email listed from the sender so i can't reply
Site reference:www.tienyudi.com/JoinMailingList4.htm
the scripts i'm using now is:
<form action="www.lga.net.sg/cgi-bin/FormMail.pl" method="post" name="Send Form" enctype="x-www-form-encoded">
<input type="hidden" name="recipient" value=" ">
<input type="hidden" name="subject" value="Mailing List Subscription">
<input type="hidden" name="redirect" value="www.tienyudi.com/sumitform.htm">
What else do I have to list in the input inorder to have the
1)name of the sender and
2)the sender's email address in the email to reply
Problem 2 (Validating Form)
With the same form: www.tienyudi.com/JoinMailingList4.htm
When i click on submit, the form validated that there are some errors, then it continued to "redirect" the form to a page when it was submitted (www.tienyudi.com/sumitform.htm) BUT the form is still NOT correctly filled! And it wasn't submitted at all due to the error.
How do i get this done correctly in such a way that the system will pin-point which field is not collectly filled and direct them to the designated field and then ONLY redirect the form to another page (www.tienyudi.com/sumitform.htm) when all the fields are correctly filled?
The scripts for the form are as below, would really appreciate your help!
<input onclick="MM_goToURL('parent','sumitform.htm');MM_validateForm('First Name','','R','Last Name','','R','Job Title','','R','Organization','','R','0','','R','Postal','','RisNum','Tel Code','','RisNum','Tel','','RisNum','Mobile Code','','RisNum','Mobile','','RisNum','Email','','RisEmail','Job Title','','R','Organization','','R','0','','R','Postal','','RisNum','Tel','','RisNum','Mobile','','RisNum','Email','','RisEmail');return document.MM_returnValue" type=submit value=Submit name=Submit>
<input type=reset value=Reset name=Reset>
I would like to include a "email varification" field as well where the user has to retype the email again for varification like how the password is done. Can someone please help me with this too?
Thank you for your time and kind assistance!
I look forward to hearing from you
Replies
Replied 30 Dec 2004 13:50:48
30 Dec 2004 13:50:48 Simon Martin replied:
<b>Problem 2 :-</b>
Download and install the Yaromat checkform extension; its better than the default Macromedia version www.yaromat.com/dw/?ex=Check%20Form%20MX
Make sure that the script is being called from the <form onsubmit="YY_checkform(.....)"> because it is the form element that you want to check and not the submit button.
Otherwise you could custom build your validation script - here's a bit of one that I used a while back that sets the focus back on the 1st element that fails the validation.
<script language="JavaScript" type="text/JavaScript">
function CheckForm() {
if(document.forms[0].contact_name.value == '')
{
/* Error message if field is blank */
alert('Please enter your Name or Company name\n\n')
/* Set focus on the field */
document.forms[0].contact_name.focus();
return false;
}
if(document.forms[0].property_street.value == '')
{
alert('You must enter the street address\n\n')
document.forms[0].property_street.focus();
return false;
}
....
{
/* if no error submit */
return true;
}
}
</script>
HTH
Live the life you love
Love the life you live
Simon
[DWMX 2004]|[SQL]|[ASP/VBScript]|[XP-Pro]
Download and install the Yaromat checkform extension; its better than the default Macromedia version www.yaromat.com/dw/?ex=Check%20Form%20MX
Make sure that the script is being called from the <form onsubmit="YY_checkform(.....)"> because it is the form element that you want to check and not the submit button.
Otherwise you could custom build your validation script - here's a bit of one that I used a while back that sets the focus back on the 1st element that fails the validation.
<script language="JavaScript" type="text/JavaScript">
function CheckForm() {
if(document.forms[0].contact_name.value == '')
{
/* Error message if field is blank */
alert('Please enter your Name or Company name\n\n')
/* Set focus on the field */
document.forms[0].contact_name.focus();
return false;
}
if(document.forms[0].property_street.value == '')
{
alert('You must enter the street address\n\n')
document.forms[0].property_street.focus();
return false;
}
....
{
/* if no error submit */
return true;
}
}
</script>
HTH
Live the life you love
Love the life you live
Simon
[DWMX 2004]|[SQL]|[ASP/VBScript]|[XP-Pro]