Bind input ID in event action

Is it possible to bind an input’s ID in a dynamics event action?

In the data bindings window, I can only select "value, disabled, validationMessage, invalid.

I have this:

<input id=“question2” name=“text2” type=“text” is=“dmx-input” dmx-on:changed=“add_answer.load({projectid: get_project_data.data.query1[0].Project_ID, questionid: 2, answer: value})”

…and would like to bind the input’s ID to “questionid”.

Is that possible?

I’m not at my PC, but try using dmx-bind:id="whatever"instead.

It might not open up the bindings picker, but if you place the right code/binding in there it should work. I’ve used dynamic ids before when using the index of a repeat.

Looking at your query, it might be something like:

dmx-bind:id= "get_project_data.data.query1[0].projector"

Thanks for your suggestion @Philip_J.

Apologies if I did not explain myself well, but I am not looking to dynamically change the ID of the input, but rather have the action event pick up the ID of the input in which it is embedded.

In my server connect I have a GET variable “questionid”, I would like the ID of the input be bind to this variable (in my example “question2”) during the dmx-on:changed.

Hope that makes more sense?

Maybe this is what you are looking for:

Thanks @George, are you suggesting to rethink my process and work with filtering instead?

Maybe this clarifies further, it is possible to get the ID of the input into this field (See arrow)?

But why would you want to pass the ID? It doesn’t change so you can just pass it as static string value.

So in your example above just enter: objectives3

Yes you are right, but if I like to scale, it might be easier to copy paste (or perhaps automate) if this is dynamic… or am I going into a wrong lane here?

If you copy and paste code you always have to make sure you are using the right variables.