-2

Found the answer! At the bottom of the page.

I would like to select two items and produce the sum of both on a website. For instance, let's say each number is a book :

Row A = 1 (U$10), 2 (U$20), 3 (U$30), 4 (U$40).

Row B = 5 (U$50), 6 (U$60), 7 (U$70), 8 (U$80).

Row C = sum.

Prototype

It would only be possible to select 1 item per row. If I choose, for example, 1 and 7, I would like in Row C the value (U$) of the sum for both, so in this case 80.

Styling aside, is it possible to code that selection+sum? Is there a way to do that that's not server-side, just client-side?

Community
  • 1
  • 1
  • Sure, use `input type="radio"` or a ` – Paul S. Feb 04 '15 at 17:22
  • It certainly possible, but we have to see your html to be able to help. Also, if you show your research, or what have you tried, people will more likely help you. (Please read this: [how to ask](http://stackoverflow.com/help/how-to-ask)) – zord Feb 04 '15 at 17:31
  • Basically would be something like this: http://prntscr.com/6118ig Most part of my research was to find if I could use an id selector (#choice1 and so forth), but it turned out not working. Google also didn't return anything I could use. Will look into – Bruno Confortin Feb 04 '15 at 17:54

1 Answers1

0

Thanks to @Paul S., I could find an answer through research.
The youtubber Ralph Phillips (I love you, thank you) explains it very well.
He explains it with the usage of <select> and also forms (input type="radio").

Here are the links:

Video tutorial

Final page

It is a generic solution and someone with basic javascript/html skills can find the way around it and make it specific to attend his/her needs.

Community
  • 1
  • 1