1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

I am getting problems with this "The field 'X' was not recognised."

Discussion in 'XenForo Development Discussions' started by Uniphix, Aug 23, 2011.

  1. Uniphix

    Uniphix Active Member

    I am stomped on trying to figure out why I am getting this.

    The thing is I have a DataWriter that extends the DataWriter and the fact is it is associated on it's own. I don't extend any controllers in the forums at all. I am stomped on how like Register works with xenForo as I am creating something similar to that for something else.

    Why am I getting this error? "The field 'name' was not recognised."


     
  2. ragtek

    ragtek Guest

    1. you should ask this stuff in the development section and not "questions and support"

    2. it seems that you've defined a field as "required" in your datamanager, but you don't set it.
    That's why the datawriter isn't saving the record and shows the error instead
     
  3. Uniphix

    Uniphix Active Member

    I have tried setting my _getFields to not have any required and it still does it, even on fields that I don't mark required... Its like it is not able to bind that DataWriter or something with ${fields.name} or something... Not sure what or why its happening the way it is
     
  4. Uniphix

    Uniphix Active Member

    here is the kick... I set the value with 'test' to see if it is showing up in the template and it is.. It seems like some sort of validation, but the validation does it for all over them
     
  5. Uniphix

    Uniphix Active Member

    Apparently I had to put "OptOut" in the class of the input or something like that so that it ignores it.
     
  6. ragtek

    ragtek Guest

    I would suggest, to check /js/xenforo.js

    There you can see what's necessary & possible with the forms;) (because of autovalidator, ajax , etc...)
    Code:
        /**
         * Handler for automatic AJAX form validation and error management
         *
         * Forms to be auto-validated require the following attributes:
         *
         * * data-fieldValidatorUrl: URL of a JSON-returning validator for a single field, using _POST keys of 'name' and 'value'
         * * data-optInOut: (Optional - default = OptOut) Either OptIn or OptOut, depending on the validation mode. Fields with a class of OptIn are included in opt-in mode, while those with OptOut are excluded in opt-out mode.
         * * data-exitUrl: (Optional - no default) If defined, any form reset event will redirect to this URL.
         * * data-existingDataKey: (Optional) Specifies the primary key of the data being manipulated. If this is not present, a hidden input with class="ExistingDataKey" is searched for.
         * * data-redirect: (Optional) If set, the browser will redirect to the returned _redirectTarget from the ajaxData response after validation
         *
         * @param jQuery form.AutoValidator
         */
        XenForo.AutoValidator = function($form) { this.__construct($form); };
     
  7. Uniphix

    Uniphix Active Member

    ah i see thanks for the input... I'll be adding validations down the road I had only a few hours to do what I did so all good. But thanks again.
     

Share This Page