Need a page to do simple calculations

Hi Everyone
I have been using freeway sometime now and finally everything is slotting into place. I am not an IT guy.

I am going to rebuild a site (for my full time business) and want to have on a page an area where simple calculations can be made. Basically my business installs garage floor coatings.
I want potential clients to be able to:

  1. input the length x width of their garage and it calculate their square footage.

2: for that square footage to then multiply by a given number for each of the systems we offer.

so an example would be 20ft x 20ft =400 square ft
400 X $4 = $1600
400 x $5 = $2000

It would be great if the resulting dollar numbers could be at the side of the relative descriptions, in various parts of the page or pages.

I do not have a clue where to start in doing this other than I can produce the formulas on a spread sheet if required.

If someone could guide me on a simple basis with this I would be most grateful. Thanks Guys.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

I’ll admit that I know next-to-nothing about forms and calculation, but this should get you started: http://freewaytalk.net/thread/view/70645


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

This is relatively easy to do in JavaScript, as long as you don’t have to trust the input on your server. For example, you would not want to do this sort of calculation in the browser and then accept the result blindly, because anything on the browser can be manipulated by the user, so they could easily set the price to 0.1 if they wanted to.

If you make a form field in Freeway for the height and width, and then a picking list with each material as a separate option, you could do this as follows:

You lay out your form with three fields: two text fields named x and y, and a picker named material. In material, you set the Name of each option to the visible name you want to give your material, and the Value to the price in cents per square foot.

(Important sidebar here: Freeway < 6 will not set an ID on form inputs, which makes it more involved to get at the value that the field is currently set to. Also, Freeway < 6 hides the Name attribute in the third tab (output) of the Inspector. Freeway 6 will accept whatever you enter in the Name / ID field on the first tab as the Name attribute, which will also be set on the third tab in the Name field.)

Finally, you make an HTML box where you want your result to appear on the screen. Inside that box, enter some placeholder text (this will be hidden when the page loads, so entering “Please enable JavaScript to use this feature.” is a good choice). When styling this text, you need to use a paragraph-level style, not an inline style made with the Inspector’s text styling options, otherwise the styling will be removed by the script, and you’ll see 16px Times Roman in most browsers. Make a note of the Name / ID assigned to this box by Freeway (or set it to something of your choice, like ‘message’, so you can access it later.

Apply the Protaculous 2 Action to your page, and click on the DOM Loaded Observer button. In the code dialog that appears, paste in the following code:

That’s going to check the current value of the form every 3/10 of a second and update with the newest values, so this will be very responsive and “live”.

Walter

On Feb 16, 2013, at 2:33 PM, Mike Blackshaw wrote:

Hi Everyone
I have been using freeway sometime now and finally everything is slotting into place. I am not an IT guy.

I am going to rebuild a site (for my full time business) and want to have on a page an area where simple calculations can be made. Basically my business installs garage floor coatings.
I want potential clients to be able to:

  1. input the length x width of their garage and it calculate their square footage.

2: for that square footage to then multiply by a given number for each of the systems we offer.

so an example would be 20ft x 20ft =400 square ft
400 X $4 = $1600
400 x $5 = $2000

It would be great if the resulting dollar numbers could be at the side of the relative descriptions, in various parts of the page or pages.

I do not have a clue where to start in doing this other than I can produce the formulas on a spread sheet if required.

If someone could guide me on a simple basis with this I would be most grateful. Thanks Guys.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Thanks to Caleb and Walter for your help. Much appreciated. I will make an attempt at this issue later on this week. No doubt watch this space for more questions (lol) I just don’t get programming. Again sincere thanks… Mike


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options