2
Is it possible to create a dynamic table with the addition of rows and columns? According to the picture, the situation is: - Starts a table with 3 columns and a row; - Whereas the first line and the first column would have to be editable (it would be possible for the user to type in it); - Inside the empty lines would bring radio button;
Now comes the part where I can’t find a solution: - When you click the button + from the horizontal you will add one more column( maximum 5 columns); - When you click the + button from the vertical you will add one more line; - And they need to always be hitting the column with the lines, as shown in the image.
I did not understand the vote against, it would be important the feedback of the pq to negative the answer, so maybe it could improve it.
– abfurlan
Sorry I didn’t inform you before, I only gave the negative point because I didn’t follow the maximum of 5 columns quoted above, and of course this point can be reversed.
– Mateus Veloso
@Mateusveloso ok I understand, I did the code in the rush and I didn’t notice, but I’ve corrected
– abfurlan
@abfurlan your example is great, I’ll work on it, a question, in your example I can only select a radio, this must be what you talked about the challenge of identifying a radio for each question, you have some suggestion of the way to it?
– Isa
@Isabellameirelles yes is one of the challenges, the name of the inputs were identical and so could only select one, see my edition with an idea of how to solve this problem.
– abfurlan
@abfurlan Thank you so much for your help!!!
– Isa
@Can I ask another question? If I wanted to remove the line that corresponds to: "answer" and the two radiosbuttons (which is the line that already comes in html, and leave it to be only for this addition to be done via the inputs (as already occurs in the next created lines), would I change all the logic applied in js? I tried to make a change to it but always disfigure the whole table
– Isa
@Isabellameirelles yes, in this case changes the logic, will have to do some checks, but I believe that the easiest will be to create the table from scratch when there is no question yet. As soon as I get a break I’ll see if I can edit.
– abfurlan
@abfurlan thank you, I’m trying to change but still unsuccessful, I feel like a lot
– Isa
@Isabellameirelles see my edition, I believe it’s now ok
– abfurlan
@abfurlan solved yes!!! thank you for your great help!!!
– Isa