AutoForm is a Meteor package that adds UI components and helpers to easily create basic forms with automatic insert and update events, and automatic reactive validation.
@aldeed does resetOnSuccess=false work on latest version of autoform(6.3.0)? I have similar requirements to keep an update form from resetting after submission but attempts to use this method doenst work.
AutoForm.hooks({
aboutEventUpsertForm :{ //insert update (upsert) form https://forums.meteor.com/t/upsert-in-autoform/7161/6?u=nosizejosh
onSubmit: function (insertDoc, updateDoc, currentDoc) {
this.event.preventDefault();
return false;
},
onSuccess: function(formType, result) {
// set resulting newly created eventid to the currentEventId to aid in uspert form creation
// console.log(result);
CurrentEventId.set(result);
Bert.alert({
title: 'Registration Success',
message: 'Charter Registration Successfull!',
type: 'success',
style: 'growl-top-right',
icon: 'fa-money'
});
// trying to prevent update form from refreshing after successful update
this.event.preventDefault();
return false;
},
onError: function(formType, error) {
// must check if for specific error before calling bert, else bert will always be called for any onError
Bert.alert({
title: error.error,
message: error.message,
type: 'danger',
style: 'growl-top-right',
icon: 'fa-frown-o',
hideDelay: 5000,
});
},
}
});
@aldeed does resetOnSuccess=false work on latest version of autoform(6.3.0)? I have similar requirements to keep an update form from resetting after submission but attempts to use this method doenst work.
// ui code
// template code
anyone with knowledge on this please help.