# Simple javascript, multiplying variables and displaying in alert box

**URL:** <https://forum.kirupa.com/t/simple-javascript-multiplying-variables-and-displaying-in-alert-box/158553>\
**Category:** web dev\
**Created:** [August 10, 2005, 2:03pm UTC](https://forum.kirupa.com/t/simple-javascript-multiplying-variables-and-displaying-in-alert-box/158553 "2005-08-10T14:03:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Oli\_G](https://avatars.discourse-cdn.com/v4/letter/o/f05b48/32.png) [@Oli\_G](https://forum.kirupa.com/u/Oli_G)\
**Post date:** [August 10, 2005, 2:03pm UTC](https://forum.kirupa.com/t/simple-javascript-multiplying-variables-and-displaying-in-alert-box/158553/1 "2005-08-10T14:03:57Z")

</div>

Gawd… cant believe im asking this. I can understand and explan code in front of me just fine, but its writing it thats the pain!

I have a form with three text boxes.

One text box is for the user to insert a length value (numerical)

One text box is for the user to insert a height value (numerical)

One box is for the user to select a price (numerical)

When we process the form, I just need to display an alert box that multiplies the two values from the first 2 text boxes, adds 25% of that to the figure, and then multiplies that final figure by what was entered in the third text box.

So ie, in the alert box: “The total area is '(length)_(width)25%+"and the cost is '((length)(width)25%)_(cost)”

Totally off, but i think it helps illustrate what i need. Nothin too complex.

Dead easy really, but I just dont know the proper syntax!

Anyone able to shed some light for me?
