-1
I am developing a plan table, where the values of these plans vary according to the options selected in (are 4 selection options).
This part of changing the value of the plan according to the options chosen has already been resolved, however, the "JOIN" buttons to the plans, do not vary according to the options selected. (These links will direct to the purchase of this subscription plan, as each combination of the selected options is a value, I would like the links of the buttons to vary as well as the selected options.)
Follow the table link: https://piscinafacil.com.br/tabela_teste.html#
Do you want to change only the link according to each table and its respective information? If understood correctly just generate the full link in js and print next to HTML.
– Lucas Thibau Paulino
This @Lucasthibaupaulino , was going to be a different link for each combination of the 4 select options. Since I don’t have much experience with js, I would like to ask for your help in structuring this part of js. Because the js that is already in the table was done by another person, I only developed the html and css part myself. If you can help me, I would be extremely grateful, because that’s all that’s left to finalize the table. Thank you!
– Eduardo Marotti
@Lucasthibaupaulino I saw that you had posted an answer but was deleted... Can you help me?
– Eduardo Marotti
Basically you will assemble an array with the options that are being sent to mount the table, from this array, you concatenate everything and generate the link. To know how to do this exactly, you need to see your code.
– Lucas Thibau Paulino
@Lucasthibaupaulino Certo Lucas, was not getting to post the whole code here. But if you enter the link that is the table will be able to display its source code. The other boy who answered the question has already posted an example of what the code would look like, but the link only changes when an option is selected. In my case, the link would have to change when a set of options is selected. Thanks again for the help!
– Eduardo Marotti
The answer of @Leandro Silva was correct and serves to solve your problem, the question is that instead of only one if you will have several if and concatenate the results of each if to in order generate a url.
– Lucas Thibau Paulino