Skip to content
Advertisement

Calculate the percentage for a Value when button is clicked using JS PHP

I am working a table which displays option of tokens that a user can stake with a 30days, 60days, 90days option. The default percentage for 30days is specified in the database, but i want a situation whereby when a user clicks 60days, the displayed percentage increases by say 30% and when they click 90days it increases by 60%. I am new to developing and do not know the Javascript or or Jquery to employ. My table is below. Thanks in advance!

EDIT: I am using radio input, I want the Value of the radio to be used for calculating the default percentage for specified in the database.

JavaScript
JavaScript

Advertisement

Answer

The solution is little complex, but its just coding:

i suggest you to change the value of name for radios button s for each row, or you could just select only one radio button among all, so i suppose you want to select the choice for each row. so i have rename radios1 for the second row

JavaScript
JavaScript
JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement