Okay, here is where I am not Pullo. I would love to have the PHP code to process the form myself, but this formMail.php has additional features like captcha, error handling, conditional fields etc etc which would be very difficult to recreate without extensive coding. And I have been using on few forms already.
But here is what my problem is. This is my Form page registration.html where we started, that you provided.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Calculate total order</title>
<script type="text/javascript">
window.onload = function(){
var sel = document.getElementsByTagName("select");
var adult = document.getElementById("adult");
var child = document.getElementById("child");
var single = document.getElementById("single");
var child2 = document.getElementById("child2");
var people = document.getElementById("people");
var cost = document.getElementById("cost");
var GRNDTOTAL2;
function updateTotal(personType, personAmount){
// Update number
countAdults = parseInt(adult.options[adult.selectedIndex].text);
countSingle = parseInt(single.options[single.selectedIndex].text);
countChild = parseInt(child.options[child.selectedIndex].text);
countChild2 = parseInt(child2.options[child2.selectedIndex].text);
if (countAdults) {
costAdults = 25;
}
else {
costAdults = 0;
}
if (countSingle) {
costSingle = countSingle * 10;
}
else {
costSingle = 0;
}
totalCostAdults = costAdults + costSingle;
totalCountAdults = countAdults + countSingle;
totalCountChildren = countChild + countChild2;
totalPeople = totalCountAdults + totalCountChildren;
peopleText = totalCountAdults + ' adults and ' + totalCountChildren + ' children (' + totalPeople + ' in total)';
people.innerHTML = peopleText;
// Update cost
totalCost = totalCostAdults;
cost.innerHTML = '$' + totalCost;
document.getElementById("hiddenTotal").value=totalCost;
document.getElementsById("GRNDTOTAL2").value =totalCost;
}
for(var i=0; i<sel.length; i++) {
sel[i].onchange = function(){updateTotal()};
}
};
</script>
<script type="text/javascript" src="../formMail/v8.30/formval.js"></script>
</head>
<body>
<form method="post" action="http://www.mysite.com/formMail/formMailEngine.php" name="RegistrationForm">
<input type="hidden" name="recipients" value="myaddress" />
<!-- Defined in INI File -->
<input type="hidden" name="subject" value="PROGRAM REGISTRATION" />
<input type="hidden" name="good_template" value="/fmTemplates/fmConfirmationtest.html" />
<input type="hidden" name="bad_template" value="/fmTemplates/fmErrorHandlerPage.html" />
<input type="hidden" name="bad_url" value="/fmbadhandler/fmbadhandler.php" />
<!-- required to handle special error codes in error tmplt -->
<input type="hidden" name="this_form" value="/registration.html" />
<input type="hidden" name="autorespond" value="HTMLTemplate=/fmtemplates/autoRespondtoUser.html, Subject=Registration Confirmation from Web,TemplateMissing=" />
<input type="hidden" name="mail_options" value= "CharSet=UTF-8,HTMLTemplate=/fmTemplates/frmDataToWebMaster.html,NoEmpty, TemplateMissing=,Exclude=email;submit"/>
<!-- =================== ^^ EDIT FOR EACH EVENT ^^ ====================== -->
<br />
<input class="formselectwhite" size="40" name="FullName"/>
<br clear="all" />
<br clear="all" />
<input class="formselectwhite" size="40" name="email" id="emailvalue"/>
<br clear="all" />
<br clear="all" />
<input class="formselectwhite" name="Telephone" value="" type="text"/>
<br clear="all" />
<br clear="all" />
<label for="adult">ADULTS ($25)</label>
<select id="adult">
<option>0</option>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
</select>
</div>
<div>
<label for="child">CHILDREN ($0)</label>
<select id="child">
<option>0</option>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
</select>
</div>
<br/>
<div>
<label for="single">SINGLES ($10)</label>
<select id="single">
<option>0</option>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
</select>
</div>
<div>
<label for="child2">CHILDREN ($0)</label>
<select id="child2">
<option>0</option>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
</select>
</div>
<div style="width: 40%; float: left;">
<input type="submit" value="Submit Information!"> </div>
</form>
<p> <strong><br />
Total</strong><br />
People: <span id="people"></span><br />
Cost: <span id="cost"></span><br />
Display: <span><input type="text" id="hiddenTotal" ></span>
<p>
</body>
</html>
Now here is the confirmation page fmConfirmationtest.html that the User sees when they press the Submit button.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<div style="width: 100%;">
<table>
<tr>
<th colspan="2">Your Registration Summary</th>
</tr>
<tr class="yellow">
<td width="142">Details</td>
<td width="166">Your Input</td>
</tr>
<tr>
<td>Full Name</td>
<td>$FullName</td>
</tr>
<tr>
<td>Email Adress</td>
<td>$email</td>
</tr>
<tr>
<td>Phone Number</td>
<td>$Telephone</td>
</tr>
<tr>
<td>Your Contribution</td>
<td>$hiddenTotal</td>
</tr>
<SCRIPT LANGUAGE="JAVASCRIPT" TYPE="TEXT/JAVASCRIPT"></script>
<tr>
<td colspan="2" class="mediumred">.</td>
</tr>
</table>
</div>
</body>
</html>
Here are the screen shot of what I get when I am on the form:
As you can see the value in the “Display” field is showing a value and it is using hiddenTotal.
But that same $hiddenTotal is coming up null in the confirmation page, thus “Your Contribution” is empty. So that’s all that need to be fixed. Somehow be able to pass the value of the hiddenTotal to the next pages, emails etc.
I am assuming that if we get it show up correctly on the confirmation page then it will also work on all the email notification as well.
Hope this helps. Unfortunately you may have to get the free formMail from tectite.com for the processor. I can send everything that I use, but that would be rather large.
If you create your own PHP script and make this work, then again we may have a problem in that the FormMail may be handling it differently than your script and end up with the same issue.
Please note that the form processor is indeed passing the values of all other fields, except our calculated field. So if we can figure out the right way to pass that value through, then that solves the problem (hopefully).