How to Build responsive forms?

Permalink
I'm looking to build a page which calculates building materials.

a person could enter
# of solid panels
# of window panels
# of door panels

And see an out put of the total number of 2x4, sheets of ply wood.. as well as cost.
Either live as you'd see in excel. Or maybe a click submit and see results?

Any add-on out there for this?

Thanks

 
ScottSandbakken replied on at Permalink Reply
ScottSandbakken
I don't know of any add-ons, but if you are not trying to save the information to the database you could use an External Form (http://www.concrete5.org/documentation/editors-guide/in-page-editing/block-areas/add-block/external-form/) to post to a single page with a PHP script to do your calculations.
stonereptiles replied on at Permalink Reply
Agh that would involve a lot of reading on how to do forms.

I wonder if there's something to convert excel to php heh.

Thanks. will look into it.
arrestingdevelopment replied on at Permalink Reply
arrestingdevelopment
If PHP isn't your forté, maybe jQuery/Javascript would be easier? A quick Googling found this jQuery calculation plugin that can do math on fields on a page:

http://www.pengoworks.com/workshop/jquery/calculation/calculation.p...

If you scroll down the page a bit, they have an example of an order form layout... when the quantity changes, the line-totals and grand-total re-calculate automatically.

Worth a look!
stonereptiles replied on at Permalink Reply
Thats actually pretty close to my needs.
I'm just really new to the material. would take some serious time to get it worked out.

My php doesnt suck.. but..

<?php
$sw = 2; 
$ww = 2;
$dw = 2;
$stud = 1.50; 
$t24 = 2;
$824 = 2.5;
$sheets = 7;
$req_studs = ($sw * 3) + ($ww * 4) + ($dw * 5);
$req_t24 = ($sw + $ww + $dw) * .5;
$req_824 = ($sw + $ww + $dw) * .5;
$req_sheets = ($sw + $ww + $dw);
$cost_total = ($req_studs * $stud) + ($req_t24 * $t24) + ($req_824 * $824) + ($req_sheets * $sheets);
?>
<table border="1" width="34%">

I get an error on line 7 I believe
stonereptiles replied on at Permalink Reply
Wow posting that on here. Made me realize that i cant use $ and a number for code. needs to be $ letter.
Erik74 replied on at Permalink Reply
Letter or underscore.

$LetterNumber
$_Number