Need Help With Form

I’m new to coding calculations in forms. Any suggestions greatly appreciated. This is just a generic test form I designed in DW. I’m trying to figure out how to add the dollar value of radio group “sessionoption" to the dollar value of radio group sessionoption.”

Somehow I have to post the sum of these two values into tag: <INPUT type="hidden" name="chargetotal" value=" ">

This is for a simple order form that will eventually go to a gateway. I’m just trying to get the easiest method for creating this calculation (maybe a javascript). Even a reference to a tutorial would be helpful. Here is the code:

<body>
<form id="form1" name="form1">
<p>
<INPUT type="hidden" name="chargetotal" value=" ">
<INPUT type="hidden" name="storename" value="000000">
<input type="hidden" name="taxexempt" value="1">
<input type="hidden" name="txntype" value="preauth">
<input type="hidden" name="authenticateTransaction" value="true">
<input type="hidden" name="responseURL" value="http://www.mystore.com/receipt.cgi">
<input type="hidden" name="oid" value="webform1">
<br />
<br />
<br />
</p>
<FORM action="https://www.mygatewaytest.com/lpc/servlet/lppay" method="post">
<table width="100%" border="0">
<tr>
<td>
Please Choose On Of The Following Consultation Amounts:<br />
<br />
<table width="314">
<tr>
<td width="306"><label>
<input type="radio" name="sessionoption" value="20.00" id="sessionoption_0" />
45 Minutes ($20.00)</label></td>
</tr>
<tr>
<td><label>
<input type="radio" name="sessionoption" value="15.00" id="sessionoption_1" />
35 Minutes ($15.00)</label></td>
</tr>
<tr>
<td><label>
<input type="radio" name="sessionoption" value="10.00" id="sessionoption_2" />
25 Minutes ($10.00)</label></td>
</tr>
</table>
</td>
</tr>
</table>
<table width="100%" border="0">
<tr>
<td><br />
Please choose one of the options for a recording of your consultation:<br />
<table width="200">
<tr>
<td><label>
<input type="radio" name="audiooption" value="5.00" id="audiooption_0" />
postal mail ($5.00)</label></td>
</tr>
<tr>
<td><label>
<input type="radio" name="audiooption" value="3.00" id="audiooption_1" />
email ($3.00)</label></td>
</tr>
<tr>
<td><label>
<input type="radio" name="audiooption" value="00.00" id="audiooption_2" />
none</label></td>
</tr>
</table>
</td>
</tr>
</table>
<br />
<label>
<INPUT type="submit" value="Continue to secure payment form">
<br />
<br />
</Form>
<br />
<br />
<br />
<br />
</body>
 

zkiller

Super Moderator
Staff member
i would suggest using a server side language such as php or asp for this instead of javascript.

in asp this would look something like...

Code:
<%
dim ValueOne, ValueTwo, TotalAmount

ValueOne = Request.Form("sessionoption")
ValueTwo = Request.Form("audiooption")

TotalAmount = ValueOne + ValueTwo

Response.Write("Your total comes to $" & TotalAmount)

%>
that's a very basic example.
 
zkiller - After hours of research, I found out the javascript might not work in a form such as this in some situations, so this goes along with what you are recommending.

php coding is a little over my head. I can edit it once it's there, but I'm not to good at creating it from scratch. Do you have any suggestions to where I can get someone to code the form for me? Of course, I'm willing to pay. I already went to rent a coder but I never heard back from anyone. Thanks for any help.
 

zkiller

Super Moderator
Staff member
personally, i would take the time to familiarize myself with a language such as php. it will save you loads of time and money in the long run.

but to answer your questions, i'd suggest trying the sitepoint (www.sitepoint.com) marketplace or contests section. loads of very experienced coders on their. you could also try posting something in the requests section here on WDF.

good luck. :)
 
Top