Capturing the value of an input field within a collection

I have a list of inputs:

image


Additional info in comments

I want to use this js on the add icon, so that a value must exist:

image

I can use this code in the console:

image

But the error in WeWeb is preventing me from progressing. What should I do? Is there a better way to get the value of an input as it exists inside a list (inside a list)? Thanks!

(I know the console code vs the weweb code does differ slightly, but any variation of trying to get that input’s value is met with the error above)

if you want to use js you need to replace document with wwLib.getFrontDocument()

Anyway it’s not ideal to do this just to get the input value. You can keep track of the value 100% with nocode. See this example.

1 Like

You should not do this with Javascript, you’re risking it will break the underlying VueJS logic. Look up @dorilama’s tutorials on how to do this properly, it will save you way too much time.

Thanks, this helped a ton.

1 Like