You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Prehaps this is not the best approach, but hopefully if not someone can suggest a better one. My form is simple in that it just creates a JSON object and Adds and deletes "components" to the JSON. I am trying to add a modify option. When modify is selected and the component ID from the JSON object is chosen, i need to load the data into each form element. I thought i could do this through on form change using this
constcomponentElement=context.panel.elements.find((element)=>element.id==="action");// Handle the 'Modify' actionif(componentElement.value==='Modify'){// Check if window.formData exists and is an objectif(typeofwindow.formData==='object'&&window.formData!==null){// Check if there is a 'Components' array in the objectif(Array.isArray(window.formData.Components)){// Update the form elements with the corresponding values from window.formDataonChange(context.panel.elements.map((element)=>{// Find the component with the same ID as the element (without the "installer" prefix)constcomponent=window.formData.Components.find(component=>'installer'+component.ID===element.id);// If the component was found, update the element value with the component valueif(component){return{ ...element,value: component.value};}else{// If the component was not found, return the element unchangedreturnelement;}}));}}}
I would expect description to be filled in
Json object created
I get the error onchange is not defined
The text was updated successfully, but these errors were encountered:
Prehaps this is not the best approach, but hopefully if not someone can suggest a better one. My form is simple in that it just creates a JSON object and Adds and deletes "components" to the JSON. I am trying to add a modify option. When modify is selected and the component ID from the JSON object is chosen, i need to load the data into each form element. I thought i could do this through on form change using this
I would expect description to be filled in
Json object created
I get the error onchange is not defined
The text was updated successfully, but these errors were encountered: