So recently, I have been working on my math program, and I’ve stumbled across something. Inside an array, I have the data of math questions. For example , let’s say a user answers 10 questions, and two of them are incorrect. I have an array that is 2 entries long, each entry containing the question they missed (ie., a string “What is f(3) when f(x) = -4x + 11”). Since there are 2 entries, I’d like to insert/create two textboxes on the page, and change their text to the question string.
I know how to change the text, but how do I create a textbox using only Wix Velo code ( with HTML if I need to position it)?
Hello. I"m not sure if I am understanding this completely but can’t you just add the text boxes through the drag/drop, hide them on page load and then you can programmatically show them and/or update text as needed?
That’s true, however the issue is that there’s no way to tell how many questions the user will answer. For example, a user answers 3 questions correctly so 3 text boxes get created. If they answer 60 questions correctly, 60 text boxes get created.
I see. Thank you for providing some clarity in your use case.
If the amount of additional elements you need will always change, you will likely need to use a custom element.
The only other approach that may work is using a repeater instead of text boxes and having the correct answers query the data that populates the repeater to only filter and show however many items it should based on the answers.
About Custom Elements
ABout Repeaters