PDA

View Full Version : Help with an auto responder form



davidboon
08-17-2009, 12:24 PM
Hi guys i need help, i recently downloaded this free Ajax auto responder contact form, my knowledge with php and java script is quite basic.
the form can be found at the link below
http://ramui.com/documentation/ajax-contact-form-with-auto-responder.html
I added fields to the contact form, the form works well. however when you test the contact form, an email is sent to my email address, that all works fine. However i dont receive the information for the fields that i have added to the contact form in the email that i receive. all that appears is the IP address/Date/Message and sender email address.
Im assuming i need to tweak the code in one of the files. I think the file called mail.js is where i need to fiddle around with.
Could someone help? the code is below


function validateForm(max){
var errors='';
var str=fw_trim(document.getElementById('fw_contact_name').value);
if (str.length > 40){
errors='Name must be within 40 characters.\n'; }
if (str.length <3){
errors='Write your name.\n'; }
str=fw_trim(document.getElementById('fw_contact_message').value);
if (str.length > max){
errors+='Please enter your Phone Number'+max+'characters.\n'; }
if (str.length <7){
errors+='Enter you phone number.\n'; }
str=fw_trim(document.getElementById('fw_contact_subject').value);
if (str.length > 78){
errors+='Subject length must be within 78 characters.\n'; }
str=fw_trim(document.getElementById('fw_contact_address').value);
if (str.length > 78){
errors+='Please enter your Address.\n'; }
str=fw_trim(document.getElementById('fw_contact_from').value);
if (!((str.indexOf(".") > 0) && (str.indexOf("@") > 0)&&(str.length < 100))){
errors+='Enter correct email id\n'; }
var code = parseInt(document.getElementById('fw_contact_captcha').value);
if ((code < 1000) || (code > 9999) || isNaN(code)) {
errors+='Enter correct varification code\n'; }
if (errors){
alert('The following error(s) occurred:\n'+errors);
return false;}
return true;
}
function fw_mail(){
if(validateForm(3000)){
var url = "mail/index.php?sendmail=true";
var params = "name=" + fw_total_encode(document.getElementById('fw_contact_name').value) + "&from=" +fw_total_encode(document.getElementById('fw_contact_from').value) +"&subject=" + fw_total_encode(
document.getElementById('fw_contact_subject').value) + "&message=" +fw_total_encode(document.getElementById('fw_contact_message').value) + "&captcha_code=" + fw_total_encode(
document.getElementById('fw_contact_captcha').value);
var fw_connection=fw_connect(url,params);
fw_connection.onreadystatechange = function(){
if(fw_connection.readyState == 4 && fw_connection.status == 200){
document.getElementById('feedback').innerHTML = fw_connection.responseText;}}}}