At the moment I am not able to get the options of a dropdown, to manipulate the values. The dropdown is filled by a list lookup field to another sharepoint list.
I started with a simple debug, which looks like
var options = $(fd.field("Hardware").$el).find("option");
console.log(options); //--> length of options is 0
setUserHardware(); //I want to manipulate the options
It looks as if the content of the dropdown will be loaded afterwards.
Can you help me please? Thanks.
Welcome to the community! Hope you enjoy using Forms. You are right though, some things are different. Lookup fields do not have all the options loaded when the form opens - they are dynamically retrieved when a user opens the dropdown/searches the field.
If you can tell me more about the case that you have, maybe we can help you with the code. If you absolutely have to have these values stored in the lookup field, you might be able to get them by sending a request to the list and retrieving the values directly, as opposed to getting them from the lookup.
If you instead want to do something with the presentation of options, or maybe exclude some options from the dropdown, this can be done without retrieving the values first.