How can I structure a forum post with a voting feature and answer input fields in Bubble forum?

How can I structure a forum post with a voting feature and answer input fields in Bubble forum? Specifically, when a user clicks the “Add answer” button, a new input field should be generated, and when the “Delete” button is clicked, the corresponding input field should be removed. I have attempted to implement this feature but have run into issues with adding and deleting input fields. How can I structure this forum post to achieve the desired functionality?

2 Likes

Have a data type of “answers”.

In your forum posts data type, add a type of ListOfAnswers and have it be a list of the new data type “answers” you just made.

Now when a user presses add answer you add an answer to that forum posts ListOfAnswers.

That should do it!

thank you Sur , but i structured it in database problem i faced in design that when i make more than input to recive polls for question :

  • i make four inputs (first one is visible and others are hidden ).
  • i set state intial = 1 , when he press add state will be added by 1 .
  • each group be visible when state is added ( input 2 will be visible when state is < 3 condition like this ).
    – problem here
    • that when he have to make three or four polls and want to delete the the second poll
      i decrement the state by 1 so the the third that will be unvisible .
    • when i deal with this by visible and i stacked and dealing in workflow will be so hard .
  • I was wondering if you could possibly provide some assistance with a problem I’m encountering in this situation I’m having some difficulty with it and was hoping for some guidance. If you’re not familiar with it, that’s completely okay."

Create state of page ‘answerInputVisible’ yes/no. Default no.

When add answer is clicked, set page’s answerInputVisible to yes.
When delete answer is clicked, set page’s answerInputVisible to no.

Add conditional to input box ‘when page’s answerInputVisible is yes’ this element is visible. Go to layout tab of the same input and set ‘visible on page load’ to unchecked and check collapse when hidden.

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.