Jump to content

Recommended Posts

Hi everybody, Im new to javascript and need some help building a price calculator.

 

Im looking to build something similiar to this http://psdtowp.com/order-now only I've no idea where to start.

 

From applying my own thoughts I was going to set a list of undefined variables which are populated from input fields on keyup, The total would then be calculated on the submit button as I've no idea how to do it on the fly and already im getting stressed out  :o.

 

My current JS is

/////////////////////////////////////////////////////////////////////

// Variables

// Content/SLA
var ContentMinutes = '';
var ContentMinutesSelector; // Switch Case
var ServiceLevel = 5;  //This is set as a test, it will actually get a value from input
var NoOfFrames = '';

// Render Time (Hairier the Better)
var AvgFrameRenderTime = '';
var AvgFrameRenderTimeSelector; // Switch Case
var CoresInTest = '';

// Other
var EstimatedCoreHours = 10; //This is set as a test, it will actually get a value from input

// Cost Estimate
var CostEstimate = ServiceLevel * EstimatedCoreHours;


/////////////////////////////////////////////////////////////////////

//  Functions

function CalculateEstimate() {	
parseInt(document.getElementById("PriceEstimate").innerHTML=CostEstimate.toFixed(2));
}

Link to comment
https://forums.phpfreaks.com/topic/237259-price-form-calculator/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.