dynamic form , how to delete old field ?

Hello ,

I have a form loaded with values and I have a part of this form that can change dynamically when I switch a combo .
I use define/reconstruct/refresh for rebuild the part of form and after when I use form.getValues() , I have the old field present yet.

I don’t want to give in my ajax request the old field.

for example if I had 3 fields when I load : _dyn_field_1 : “1”, _dyn_field_2 : “2”,
,_dyn_field_3 : “3”, when I reconstruct the form to pass to one field , I just wan’t to see _new_dyn_field_1 : “4” , in console.log(form.getValues()).

How to do that ?

Thanks

try to clear the form before reconstructing
https://docs.webix.com/api__link__ui.form_clear.html

Hello , it doesn’t work , with "clear"the value is cleared but the key is always present :wink:

yes, you need to clear just after reconstructing:
https://snippet.webix.com/6t5a0y1z

Thanks , if I wan’t to keep all forms values but clear “dyn” values , how it possible ?
I give you the snippet for illustrate : https://snippet.webix.com/cglqfgh0

if you use some prefix for dynamic fields, you can implement this hack
https://snippet.webix.com/wz95wupp

Perfect :wink: thanks