backbone-forms icon indicating copy to clipboard operation
backbone-forms copied to clipboard

Validation error of nested Form if not available

Open sfakir opened this issue 10 years ago • 3 comments

Browser Console Output:

_error: TypeError: this.nestedForm is undefined_

Solution: check if nestedForm is set in Line 2040 ( add if statement)

    validate: function() {
         if (!this.nestedForm) return;

        return this.nestedForm.validate();
    },

sfakir avatar Mar 15 '14 16:03 sfakir

In what situation do you get this error?

powmedia avatar Mar 15 '14 16:03 powmedia

  1. having a nested model and custom template leads to not rendered nested forms. If I press save then, this error occurs
  2. I fixed the original problem by following "update two" of the following stack overflow post: (the original problem is that nested Forms were not rendered automatically with a custom template)

http://stackoverflow.com/questions/17196904/backbone-forms-with-nested-models-and-custom-template

sfakir avatar Mar 15 '14 16:03 sfakir

Would you be able to submit a pull request with this change? On Mar 15, 2014 4:30 PM, "sfakir" [email protected] wrote:

  1. having a nested model and custom template leads to not rendered nested forms. If I press save then, this error occurs
  2. I fixed the original problem by following "update two" of the following stack overflow post: (the original problem is that nested Forms were not rendered automatically with a custom template)

http://stackoverflow.com/questions/17196904/backbone-forms-with-nested-models-and-custom-template

Reply to this email directly or view it on GitHubhttps://github.com/powmedia/backbone-forms/issues/369#issuecomment-37730327 .

powmedia avatar Mar 15 '14 16:03 powmedia