Online cost calculator

I want to add an online building cost calculator to my website, similar to this http://www.homebuilding.co.uk/CostCalc.asp and from previous advice on the forums, it seems that this can be done using javascript and php. Am I right in thinking this, and if so where do I find sources/actions to create something like this? I’m using FW4 Pro and have very elementary website and web-authoring knowledge.


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

You could do this entirely in JavaScript – if the results of the
calculation were for the benefit of your visitors, and not something
you relied on for commerce or similar. (Ms. Hacker says, “Hmmm. If I
adjust this price variable to $0.001, I can finally get that plasma
TV I’ve been wanting…”)

If you mock up a form that has all of the values you need, I can show
you how to make that form constantly do the arithmetic and keep an
output field up to date using JavaScript.

Walter

On Apr 24, 2008, at 8:53 AM, Jan Liberadzki wrote:

I want to add an online building cost calculator to my website,
similar to this http://www.homebuilding.co.uk/CostCalc.asp and
from previous advice on the forums, it seems that this can be done
using javascript and php. Am I right in thinking this, and if so
where do I find sources/actions to create something like this? I’m
using FW4 Pro and have very elementary website and web-authoring
knowledge.


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

Walter, thank your very much for your offer - I’ll do a mock up this
weekend and get it over to you. On the point about the price
variables or rates, I would want to keep this hidden/inaccessible.
The calculator would be for my house designs, and I wouldn’t want it
to be used for others to calculate their own designs. The other thing
is, the rates would have to link to en external database so that when
the rates change they can be updated for all house types. I assume
this is possible.
Jan

On 24 Apr 2008, at 14:01, Walter Lee Davis wrote:

You could do this entirely in JavaScript – if the results of the
calculation were for the benefit of your visitors, and not something
you relied on for commerce or similar. (Ms. Hacker says, “Hmmm. If I
adjust this price variable to $0.001, I can finally get that plasma
TV I’ve been wanting…”)

If you mock up a form that has all of the values you need, I can show
you how to make that form constantly do the arithmetic and keep an
output field up to date using JavaScript.

Walter

On Apr 24, 2008, at 8:53 AM, Jan Liberadzki wrote:

I want to add an online building cost calculator to my website,
similar to this http://www.homebuilding.co.uk/CostCalc.asp and
from previous advice on the forums, it seems that this can be done
using javascript and php. Am I right in thinking this, and if so
where do I find sources/actions to create something like this? I’m
using FW4 Pro and have very elementary website and web-authoring
knowledge.


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


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

If you don’t want this to be accessible to your competitors, how will
you show it to your potential clients? You can’t exactly password-
protect something that you want to be available for all, right?

As far as making this look up rates from a database, yes, that’s
possible, but it raises the bar very steeply in terms of what you
will need to do to make it work.

At a minimum, you will need a resource that your JavaScript
application can request to get the current multiplier to use when
calculating prices. The simplest thing I can think of off the top of
my head would be to put a simple text file in the same folder, and
then manually update that text file (using a text editor and an FTP
application) with the current number to use in calculations.

For real database lookup magic to happen, you would need a relational
database like MySQL running on the server, an application layer
written in a server-side language like PHP, and a whole lot more.
This scale of investment would make sense if you have a bunch of
different products, each with their own price point, and aren’t
simply doing basic math in a browser. And that’s definitely not a do-
it-yourself project for your first foray into programming.

Walter

On Apr 24, 2008, at 9:17 AM, Jan Liberadzki wrote:

Walter, thank your very much for your offer - I’ll do a mock up this
weekend and get it over to you. On the point about the price
variables or rates, I would want to keep this hidden/inaccessible.
The calculator would be for my house designs, and I wouldn’t want it
to be used for others to calculate their own designs. The other thing
is, the rates would have to link to en external database so that when
the rates change they can be updated for all house types. I assume
this is possible.
Jan

On 24 Apr 2008, at 14:01, Walter Lee Davis wrote:

You could do this entirely in JavaScript – if the results of the
calculation were for the benefit of your visitors, and not something
you relied on for commerce or similar. (Ms. Hacker says, “Hmmm. If I
adjust this price variable to $0.001, I can finally get that plasma
TV I’ve been wanting…”)

If you mock up a form that has all of the values you need, I can show
you how to make that form constantly do the arithmetic and keep an
output field up to date using JavaScript.

Walter

On Apr 24, 2008, at 8:53 AM, Jan Liberadzki wrote:

I want to add an online building cost calculator to my website,
similar to this http://www.homebuilding.co.uk/CostCalc.asp and
from previous advice on the forums, it seems that this can be done
using javascript and php. Am I right in thinking this, and if so
where do I find sources/actions to create something like this? I’m
using FW4 Pro and have very elementary website and web-authoring
knowledge.


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


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

On 24 Apr 2008, at 14:38, Walter Lee Davis wrote:

If you don’t want this to be accessible to your competitors, how will
you show it to your potential clients? You can’t exactly password-
protect something that you want to be available for all, right?

I think we’re a bit at crossed purposes here - the rates I was talking
about are the building cost rates for the various building components
and the areas/quantities of these components in the particular
building type. So for example , a client would choose timber cladding
as a finish and this would produce a figure in the total build cost.
What they wouldn’t be able to do is enter a figure for the total area
of timber cladding on their design and have the calculator work it out.

As far as making this look up rates from a database, yes, that’s
possible, but it raises the bar very steeply in terms of what you
will need to do to make it work.

At a minimum, you will need a resource that your JavaScript
application can request to get the current multiplier to use when
calculating prices. The simplest thing I can think of off the top of
my head would be to put a simple text file in the same folder, and
then manually update that text file (using a text editor and an FTP
application) with the current number to use in calculations.

For real database lookup magic to happen, you would need a relational
database like MySQL running on the server, an application layer
written in a server-side language like PHP, and a whole lot more.
This scale of investment would make sense if you have a bunch of
different products, each with their own price point, and aren’t
simply doing basic math in a browser. And that’s definitely not a do-
it-yourself project for your first foray into programming.

There would be different products/house types, but they would all
share the same variables such as external wall finishes/roof types
etc, and there would be optional add-ons such as solar panels. And
yes I agree that as a first foray into programming, I taking on a big
project - however as a starter I want to produce a mock up that I can
then use to raise finance and to show a programmer what I’m after - in
addition to the build cost calculator, there would be other online
tools on offer.

Jan


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

Okay, then as a starter project, and so as not to get too far afield
learning too many things at once, what I would propose is that your
“database” be a set of variables in a hash that you set in the
beginning of your script, like this:

//inside of the beginning of calculator.js, for example
var cladding =  {
	'timber':  2.345,
	' t111':  0.234,
	'homosote':  0.002
	};

For a demo, not for production, this would be more than enough. It’s
not easily modified when prices change, but it does allow you to make
things dynamic in the page with a minimum of fuss, and will “stand
in” for the real thing, until the real thing comes along. When you
show it to a programmer, he or she will be able to substitute an Ajax
database lookup for that hash, and make the application look to the
database (or even a search of a supplier’s prices) for the latest
values.

Walter

On Apr 24, 2008, at 10:08 AM, Jan Liberadzki wrote:

There would be different products/house types, but they would all
share the same variables such as external wall finishes/roof types
etc, and there would be optional add-ons such as solar panels. And
yes I agree that as a first foray into programming, I taking on a big
project - however as a starter I want to produce a mock up that I can
then use to raise finance and to show a programmer what I’m after - in
addition to the build cost calculator, there would be other online
tools on offer.


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