Hello,
I have wrote for fun an internet order online form software of 450 lines of code
with Javascript and Object Pascal it's designed for small companies that
wants to sell products on internet, here is what it looks like:
http://pages.videotron.com/aminer/home.htmI am using three hidden fields: item_name and min, max inside the form
and in the client side i am using the following javascript function to calculate the order:
===
function CalculateOrder(form)
{
var cnt = 0;
var sub = 0;
var products = "";
for(i=form.min.value; i<=form.max.value; i++)
{
str= ""+form.item_name.value+i;
var oText=document.getElementsByName(str)[0]
if (oText)
{
if (oText.value>0)
{
cnt += Math.abs(oText.value);
str1= str+"_price";
oText1 = document.getElementsByName(str1)[0];
sub += Math.abs(oText.value) * oText1.value;
products += oText.value+" x Product " + str+ " @ $"+oText1.value+" + "+"\r\n";
}}}
products=products.substring(0,products.length-5);
form.Products_Ordered.value = products;
form.Total_Value.value = Monify(sub);
form.Total_Price_to_be_Paid.value = Monify(sub);
}
===
In the server side i am using a CGI object pascal program that is processing the order
and sending the form to your email adress, this is also interresting, but if you want to use
a database you can easily change the code for that, and you have to compile the server side
order.dpr source code with Delphi, i will try to port it to freepascal soon..
You can download all my source codes from:
http://pages.videotron.com/aminer/zip/myprog.zipThank you,
Amine Moulay Ramdane.