Помощник
|
Создание калькулятора, расчета стоимости натяжных потолков, онлайн калькулятор |
ArtemKR
|
Сообщение
#1
|
||
|
|
||
|
|||
xdvix |
28.3.2012, 11:24;
Ответить: xdvix
Сообщение
#2
|
|
Цену в рублях придется менять ручками в коде или 300р очень маленькаяя цена.
-------------------- |
|
|
ArtemKR
|
Сообщение
#3
|
|
Цену в рублях придется менять ручками в коде или 300р очень маленькаяя цена. Без проблем, поменяю в коде. Глвное чтобы, считал правильно при смене цены в рублях. Сообщение отредактировал ArtemKR - 28.3.2012, 11:32 -------------------- |
|
|
dan1 |
28.3.2012, 22:40;
Ответить: dan1
Сообщение
#4
|
|
<script type="text/javascript"> function check_digits(if_no_points) { var key = event.keyCode; if (!(key >= 48 && key <= 57) && key != 8 && key != 46) { event.returnValue = false; } } function calculate() { var price = 0; var room_length = document.calc.room_length.value; var room_width = document.calc.room_width.value; var tubes_quantity = document.calc.tubes_quantity.value; var lightpoints_quantity = document.calc.lightpoints_quantity.value; var angles_quantity = document.calc.angles_quantity.value; if (room_length > 0 && room_width > 0) { document.getElementById('roof_size').innerText = room_length * room_width; document.getElementById('roof_perimeter').innerText = 2 * room_length + 2 * room_width; if (angles_quantity >= 4) price = room_length * room_width * 450 + (2 * room_length + 2 * room_width) * 50 + tubes_quantity * 300 + lightpoints_quantity * 200 + (angles_quantity - 4) * 100; } else document.getElementById('roof_size').innerText = "0"; document.getElementById('price').innerText = price + "руб."; return true; } </script> <form name="calc"> <table> <tr> <td>Длина комнаты (метры):</td> <td><input size="10" name="room_length" onkeypress="check_digits()" onkeyup="calculate();" /></td> </tr> <tr> <td>Ширина комнаты (метры):</td> <td><input size="10" name="room_width" onkeypress="check_digits()" onkeyup="calculate();" value="" /></td> </tr> <tr> <td>Количество труб:</td> <td><input size="10" name="tubes_quantity" onkeypress="check_digits()" onkeyup="calculate();" value="" /></td> </tr> <tr> <td>Кол-во точек освещения:</td> <td><input size="10" name="lightpoints_quantity" onkeypress="check_digits()" onkeyup="calculate();" value="" /></td> </tr> <tr> <td>Кол-во углов в комнате:</td> <td><input size="10" name="angles_quantity" onkeypress="check_digits()" onkeyup="calculate();" value="4" /></td> </tr> <tr> <td>Площадь потолка:</td> <td><span id="roof_size"></span> м<sup>2</sup></td> </tr> <tr> <td>Периметр потолка:</td> <td><span id="roof_perimeter"></span> м</td> </tr> <tr> <td>Стоимость потолка под ключ:</td> <td><span id="price"></span></td> </tr> </table> </form> Как-то так? Разумеется сделал без стилей. Если нужно и стили подправить или сам скриптик, то пишите в личку. Поблагодарили: (0) |
|
|
ArtemKR
|
Сообщение
#5
|
|
Всем большое спасибо, прошу администраторов закрыть тему.
-------------------- |
|
|
|
Похожие темы
Тема | Ответов | Автор | Просмотров | Последний ответ | |
---|---|---|---|---|---|
как заслужить право на создание новой темы? | 7 | writer80 | 2211 | 12.3.2024, 22:54 автор: Lumex |
|
<Braga/> Создание Telegram-ботов, web-приложений, крипто-бирж, сайтов. | 2 | newbraga | 1793 | 10.3.2024, 22:04 автор: newbraga |
|
СОЗДАНИЕ : / САЙтЫ / ЛЕНДЫ / БОТЫ ТГ / ВАЙТЫ / КРЕО / СОФТЫ / ДИЗАЙН [PHP, JS, HTML/CSS] и другое | 5 | CULA | 3421 | 19.12.2023, 18:55 автор: CULA |
|
Создание и ведение аккаунтов в соцсетях ("В контакте"/Telegram) Услуги от профессионального журналиста и SMM-менеджера |
2 | AvtorXXX | 1717 | 13.11.2023, 23:47 автор: AvtorXXX |
|
Создание информационной площадки с доской объявлений | 1 | xweb | 2062 | 16.1.2023, 16:25 автор: xweb |
Текстовая версия | Сейчас: 24.4.2024, 18:35 |