PDA

View Full Version : best to use forms?



myrockmyshelter
05-29-2007, 10:29 PM
First time post.

Hi all...

I am in the process of building a website for some clients. Currently the clients use a Excel (.xls) file to to order certain items we carry. The xls file is protected except for the items amount that the client fills in. After they fill in the number they want, the calculations are done by Excel. They then save that form and send it to us via email.

So, my question is this....is it best to use a "form" to do this, and how do I get the calculations to run?

or is there some other better way?

I initally used Inline frame to just open up the xls file, but that looks kinda sloppy, and i would like to have it look more like a traditional web page.

I understand how to make the edit boxes and such, but how to get the data that the client inputs to add up while he/she is on the page, then when the calculations are done and they hit "submit" the form will be sent via email?

the calculations I need are simple addition calculations (ie, the price of each item is displayed and when the user puts in Number ordered, the next box will do the calculations....2 ordered at $1 each = 42).

Hope this all makes sense. I do not have an account# yet.

Ethan

SAman
05-29-2007, 11:47 PM
First of all, Welcome Ethan!
Next as to your question, it would be better if you posted it on the blue voda building forum, under the forms threads. You will get much quickerand better help up there. This forum is for just what it says, chit/chat. If any moderators see this could you help him out and move it?
Good Luck!!

Bethers
05-30-2007, 01:52 AM
Question was moved to an appropriate forum.

navaldesign
05-30-2007, 06:10 AM
If you wish the calculations to be realtime, meaning that all calculations are done whilst the user is typing, then you need a Javascript. If you can accept a refreshing of the page, you can do it using php.
In this second case, the form info is sent to a preview page that peforns the calculations and displayes the results, as well as button "Return to the form" and "Submit". Something based on this concept can be seen at http://www.dbtechnosystems.com/ABVFP_order.php

myrockmyshelter
05-30-2007, 06:08 PM
Thank you all for the help and the correction to where my question should go.!

I would like to do it with javascript. I found this code online:


var num1 = document.form1.text1.value;
var num2 = document.form1.text2.value;
document.form1.text3.value = parseFloat(num1) + parseFloat(num2);

I set up three text boxes and named them as such, but it does not perform the calculations. It gives me a NaN.

I think there needs to be a onChange in here...or do i totally have this wrong?

navaldesign
06-01-2007, 09:24 PM
Well, yes, you can use javascript. However, it is far more complicated than this. Have a look at: http://www.dbtechnosystems.com/formaexcel1.html Fil in the quantities and see how it works. Also try to fill in coupon VH20
It takes a lot of javascript to perform all these calculations.