function recalculatePrice() { var total = 0; total += inputs_1.getPrice(); total += inputs_2.getPrice(); total_el.text(total); btn_submit.attr('disabled', total <= 0); }
function getCheckboxes(table, is_verion_1) { var o = { items: [], getElem: function (el) { var i = 0, len = this.items.length; for (; i < len; i += 1) { if (this.items[i].inp[0] == el) { return this.items[i]; } } return null; }, clear: function () { var i = 0, len = this.items.length; for (; i < len; i += 1) { this.items[i].inp.attr('checked', false).attr('disabled', false); } }, fullElemClicked: function (clicked_el, checked) { var i = 0, len = this.items.length, el; for (; i < len; i += 1) { el = this.items[i]; if (el.inp[0] != clicked_el[0]) { if (el.is_base_scrining) { el.inp.attr('checked', false).attr('disabled', checked || false); } else { el.inp.attr('checked', checked || false).attr('disabled', checked || false); } } } }, baseElemClicked: function (clicked_el, checked) { var i = 0, len = this.items.length, el; for (; i < len; i += 1) { el = this.items[i]; if (el.inp[0] != clicked_el[0]) { if (el.is_base_scrining || el.is_base_clinik) { el.inp.attr('checked', false).attr('disabled', checked || false); } else { //el.inp.attr('checked', false); } } } }, getPrice: function () { var i = 0, len = this.items.length, price = 0, el; for (; i < len; i += 1) { el = this.items[i]; if (el.inp.attr('checked')) { if (el.is_full) { return el.price(); } price += el.price(); } } return price; }, changeStateByText: function (from_el) { var input = from_el.parents('tr').eq(0).find('td').eq(is_verion_1 ? 1 : 0).find('input[type=checkbox]'); if (!input.attr('checked')) { input.attr('disabled', from_el.attr('checked') || false); } }, changeStateAll: function (disabled) { var i = 0, len = this.items.length, el; for (; i < len; i += 1) { el = this.items[i]; el.inp.attr('disabled', disabled || false).attr('checked', false); } }, changeStateBase: function (disabled) { var i = 0, len = this.items.length, el; for (; i < len; i += 1) { el = this.items[i]; if (el.is_base_scrining || el.is_base_clinik) { el.inp.attr('disabled', disabled || false).attr('checked', false); } } } }; table.find('tr').each(function () { var $tr = $(this); $tr.find('td').eq(is_verion_1 ? 0 : 1).find('input[type=checkbox]').each(function () { var $this = $(this), base_scrining = $this.hasClass('base_scrining'), is_full = $this.hasClass('full'), base_clinik = $this.hasClass('base_clinik'); o.items.push({ is_full: is_full, is_base_scrining: base_scrining, is_base_clinik: base_clinik, inp: $this, price: function () { return parseInt($this.parent().find('span').text(), 10) || 0; } }); }); }); return o; }
You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.
Здравствуйте, подскажите какой тег использовать для увеличения значения, пример на картинке.
Вроде, про такой тег я слышала. Если есть тег прогресс бар, значит и такое должно быть.
Question
apexis
Ковырялся в скрипте и подпортил его - не высчитывает сумму верхнего левого чекбокса на странице страница
Link to comment
Share on other sites
1 answer to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.