214-564-5316
Friday, May 09, 2008
•
Portfolio
•
FAQ's
•
Pricing
•
Request Info
•
Code Examples
•
Demos
•
Marketing
•
Tutorials
•
Downloads
•
Drop down menu calculator
Select the options and click to add...
-- select one --
variable one - $10.00
variable one - $15.50
-- select one --
variable two - $20.00
variable two - $12.95
-- select one --
variable three - $30.00
variable three - $5.75
Total:
Here is the code:
<%option explicit%> <% Dim isSubmitted,v1,v2,v3,vtotal%> <% IF request.form("isSubmitted")="yes" then v1=request.form("v1") v2=request.form("v2") v3=request.form("v3") If v1="" then vl="0" else v1=formatcurrency(v1,2)*1 end if If v2="" then v2="0" else v2=formatcurrency(v2,2)*1 end if If v3="" then v3="0" else v3=formatcurrency(v3,2)*1 end if vTotal=v1+v2+v3 end if %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE>ddCalculator</TITLE> <META http-equiv=Content-Type content="text/html; charset=iso-8859-1"> </HEAD> <BODY> <form action="ddcalculator.asp" method="post" name="calcForm" id="calcForm" > <select name="v1"> <option value="0" selected>-- select one --</option> <option value="10.00">variable one - $10.00</option> <option value="15.50">variable one - $15.50</option> </select> <script> for (i = 0; i < document.forms[0].v1.options.length; i++) { if (document.forms[0].v1.options[i].value == "<%=request.form("v1")%>") { document.forms[0].v1.selectedIndex = i; break; } } </script> <br> <br> <select name="v2"> <option value="0" selected>-- select one --</option> <option value="20.00">variable two - $20.00</option> <option value="12.95">variable two - $12.95</option> </select> <script> for (i = 0; i < document.forms[0].v2.options.length; i++) { if (document.forms[0].v2.options[i].value == "<%=request.form("v2")%>") { document.forms[0].v2.selectedIndex = i; break; } } </script> <br> <br> <select name="v3"> <option value="0" selected>-- select one --</option> <option value="30.00">variable three - $30.00</option> <option value="5.75">variable three - $5.75</option> </select> <script> for (i = 0; i < document.forms[0].v3.options.length; i++) { if (document.forms[0].v3.options[i].value == "<%=request.form("v3")%>") { document.forms[0].v3.selectedIndex = i; break; } } </script> <br> <br> <input name="submit" type="submit" value="Click Here to Calculate Order"> <input type="hidden" name="isSubmitted" value="yes"> <br> Total: <br> <input type="text" name="vtotal" value="<%=formatcurrency(vtotal,2)%>"> </form> </BODY> </HTML>
•
Home
•
Contact Us
•
Terms of Service
•
Privacy Policy
•
Email Policy
•
Hosting
•
Links
•
Site Search
•