var itemAmount
$w.onReady(()=>{
itemAmount = $w('#input0').value
$w('#myButton').onClick(()=>{
hide_allInputs()
for (var i = 1; i < itemAmount; i++) {
$w('#input'+i)).show('fade')
}
})
})
function hide_allInputs() {
for (var i = 1; i < itemAmount; i++) {
$w('#input'+i).hide()
}
}
Generate some input-fields (#input0 - #inputX)
-
input0 = here you can place the amount of used inputs.
That means if you are using 5 inputs (input0 do not count), you will have 5 input-fields on your page (#input1- #input5). -
Create a button with ID = ‘#myButton’
Change the amont of items in input0 and use the button.
Your dynamic form is ready. ![]()