Apply a percentage discount to sum values

Yes exactly :+1:t2:is it possible?

or even on the value of the cell and then later add the check box

Sure it’s possible. Why not have a go at coding it yourself and I’ll help you if you get stuck.

What you’d do is iterate through all of the check boxes on the page, get the proceeding text node (here’s how) then set the value attribute of the text box accordingly.

1 Like

I’m sorry but after careful analysis, I determined that the best question to ask is whether you can paste a checkbox in the same cell which has the numerical value. This is because I start from this copy and paste the data from excel, if I had to do the opposite could not import the data with the same ease.I hope I was clear in the exposition of my idea, thank you in advance for your help

Like this?


<table><tr><td>2</td></tr></table>

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script>
$("td").each(function(){
  var val = $(this).text();
  $(this).html(`<input type="text" value=${val} />`)
    .append($(this));
});
</script>
1 Like

No I start the work simple with this example from the data copy from excel and I would like to introduce the checkbox that we created for calculations, can we introduce the checkbox assigning the same value of the cell automatically?

<table width="200" border="1">
  <tbody>
    <tr>
      <td>10</td>
      <td>22</td>
      <td>33</td>
      <td>44</td>
      <td>55</td>
      <td>66</td>
      <td>77</td>
      <td>88</td>
      <td>99</td>
      <td><p>100</p></td>
    </tr>
    <tr>
      <td>11</td>
      <td>23</td>
      <td>34</td>
      <td>45</td>
      <td>67</td>
      <td>70</td>
      <td>79</td>
      <td>90</td>
      <td>101</td>
      <td>121</td>
    </tr>
  </tbody>
</table>

The above code should do that :slight_smile:

1 Like

first of all thanks for your patience … with the script you I suggest, however, we have lost the ability to select the single or multiple price, to do all the calculations and to let the individual read-only cells, what I did wrong?

This is my bad update :sweat_smile: https://jsfiddle.net/k5twf8e4/

No worries :slight_smile:

Lol, nothing. I was being dozy. Try this and let me know if it works.

1 Like

Yes, thank you it is all perfect (Y)

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.