You need to sign in to do that
Don't have an account?
Rasbehari Das
How to reset lightning-record-edit-form filed (lightning-input-field) after submitted
First time I am submitting the form this is ok.
The second time I am opening a pop-up model but the fields are not resetting.
My code is like this
handleReset() {
const inputFields = this.template.querySelectorAll('lightning-input-field');
if (inputFields) {
inputFields.forEach(field => {
field.reset();
});
}
}
But this is not working.
Please help me
Thanks
The second time I am opening a pop-up model but the fields are not resetting.
My code is like this
handleReset() {
const inputFields = this.template.querySelectorAll('lightning-input-field');
if (inputFields) {
inputFields.forEach(field => {
field.reset();
});
}
}
But this is not working.
Please help me
Thanks
As you have mentioned you are using the lightning:RecordEditForm can you try checking the below implementation that could be of help.
>> https://www.infallibletechie.com/2018/08/how-to-set-field-values-on.html
I hope this helps and in case if this comes handy can you please choose this as the best answer so that it can be useful for others in the future.
Regards,
Anutej