{"action":"created","issue":{"url":"https://api.github.com/repos/formvalidation/support/issues/243","repository_url":"https://api.github.com/repos/formvalidation/support","labels_url":"https://api.github.com/repos/formvalidation/support/issues/243/labels{/name}","comments_url":"https://api.github.com/repos/formvalidation/support/issues/243/comments","events_url":"https://api.github.com/repos/formvalidation/support/issues/243/events","html_url":"https://github.com/formvalidation/support/issues/243","id":98951652,"number":243,"title":"TypeError: $message is undefined","user":{"login":"manovraresoft","id":2041397,"avatar_url":"https://avatars1.githubusercontent.com/u/2041397?v=4","gravatar_id":"","url":"https://api.github.com/users/manovraresoft","html_url":"https://github.com/manovraresoft","followers_url":"https://api.github.com/users/manovraresoft/followers","following_url":"https://api.github.com/users/manovraresoft/following{/other_user}","gists_url":"https://api.github.com/users/manovraresoft/gists{/gist_id}","starred_url":"https://api.github.com/users/manovraresoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/manovraresoft/subscriptions","organizations_url":"https://api.github.com/users/manovraresoft/orgs","repos_url":"https://api.github.com/users/manovraresoft/repos","events_url":"https://api.github.com/users/manovraresoft/events{/privacy}","received_events_url":"https://api.github.com/users/manovraresoft/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2015-08-04T11:59:53Z","updated_at":"2018-02-07T13:37:16Z","closed_at":"2015-08-05T12:26:40Z","author_association":"NONE","body":"this error occurs on this line:\n\n``` javascript\n$allErrors   = $message.find('.' + this.options.err.clazz.split(' ').join('.') + '[data-' + ns + '-validator][data-' + ns + '-for=\"' + field + '\"]'),\n```\n\nIssue:\nI have a multiple step form.  Inside of the form ajax is used to step the user through the process.  You click the continue button and isValid is invoked.\n\nIf valid, the next step is displayed, a new set of validators are defined.  On the second step, the error occurs on all of the forms.\n\nStep 1 (note: through js any contents inside div id='eval' gets eval() on run time):\n\n``` html\n<h3>Tell us about this person:</h3><div class=\"row\">\n    <div class=\"form-group\">\n        <div class='row'>\n            <label class=\"span6 control-label\">What will be this persons role in the system?<span class=\"reqd\"\n><span class=\"glyphicon glyphicon-asterisk\"></span></span>\n<a rel=\"formAjax.php?Action=tooltip&FormGroupID=34&FormID=PeopleType\" id=\"infoPeopleType\" class=\"infoLink\"\n><span class=\"glyphicon glyphicon-question-sign\"></span></a></label>\n        </div>\n        <div class=\"row\">\n            <div class=\"span6\"><select required data-live-search=\"true\"  id=\"PeopleType\" name=\"PeopleType\" class\n=\"selectpicker\"  tabindex=\"1\" > <option value=\"\">Select One</option><option  value=\"23\">Applicant</option\n><option  value=\"2\">Owner</option><option  value=\"93\">Sub-Tenant</option><option  value=\"1\">Tenant</option\n><option  value=\"3\">User</option><option  value=\"5\">Vendor</option></select></div>\n        </div>\n    </div>\n</div>\n\n<div id=\"eval\">\n\ncreateToolTips();\n\n$('#PeopleType').on('change', function(){\nvar selected = $('#PeopleType option:selected').val();\nif(selected == \"1\" || selected == \"93\")\n    $('div#divCommercial').attr(\"style\", \"visibility:visible\");\nelse\n    $('div#divCommercial').attr(\"style\", \"visibility:hidden\");\n});\n\n    $('#mainform')\n        .formValidation({\n            framework: 'bootstrap',\n            excluded: ':disabled',\n            icon: {\n                valid: 'glyphicon glyphicon-ok',\n                invalid: 'glyphicon glyphicon-remove',\n                validating: 'glyphicon glyphicon-refresh'\n            },\n            fields: {\n\n                PeopleType: {\n                    validators: {\n                        notEmpty: {\n                            message: \"You must select the person's role\"\n                        }\n                    }\n                }\n\n            }\n        });\n\n$('.selectpicker').selectpicker();\n\n</div>\n```\n\nStep 1 works fine.\n\nStep 2:\n\n``` html\n<h3>Associated details?</h3><div class=\"row\">\n    <div class=\"form-group\">\n        <div class='row'>\n            <label class=\"span6 control-label\">What Company is this Person associated with?<span class=\"reqd\"\n><span class=\"glyphicon glyphicon-asterisk\"></span></span>\n<a rel=\"formAjax.php?Action=tooltip&FormGroupID=34&FormID=CompanyID\" id=\"infoCompanyID\" class=\"infoLink\"\n><span class=\"glyphicon glyphicon-question-sign\"></span></a></label>\n        </div>\n        <div class=\"row\">\n            <div class=\"span6\"><select required data-live-search=\"true\"  id=\"CompanyID\" name=\"CompanyID\" class\n=\"selectpicker\"  tabindex=\"1\" > <option value=\"\">Select One</option><option  value=\"1\">BD Real Estate\n</option></select><br/><span style='color:red; font-weight:bold;'>Company not listed? <a class='fancybox'\n href='addcompany.php?type=company&formelement=CompanyID'>Add a Company here</a>.</span></div>\n        </div>\n    </div>\n</div>\n<div class=\"row\">\n    <div class=\"form-group\">\n        <div class='row'>\n            <label class=\"span6 control-label\">What Properties should this Person be associated with out of the\n Properties the Company owns?<span class=\"reqd\"><span class=\"glyphicon glyphicon-asterisk\"></span></span\n>\n<a rel=\"formAjax.php?Action=tooltip&FormGroupID=34&FormID=PropertyID\" id=\"infoPropertyID\" class=\"infoLink\"\n><span class=\"glyphicon glyphicon-question-sign\"></span></a></label>\n        </div>\n        <div class=\"row\">\n            <div class=\"span6\"><select required data-live-search=\"true\"  id=\"PropertyID\" name=\"PropertyID\" class\n=\"selectpicker\"  tabindex=\"2\" > <option value=\"\">Select One</option><option  value=\"861\">100 French \n</option><option  value=\"777\">1234 Main St. </option><option  value=\"860\">1234 Smith Ave. </option><option\n  value=\"779\">45 West 5th </option><option  value=\"862\">987 Tom St. </option><option  value=\"778\">987\n West Minister </option></select><br/></div>\n        </div>\n    </div>\n</div>\n<div id=\"eval\">\n\n\n\n    $('#mainform')\n        .formValidation({\n            framework: 'bootstrap',\n            excluded: ':disabled',\n            icon: {\n                valid: 'glyphicon glyphicon-ok',\n                invalid: 'glyphicon glyphicon-remove',\n                validating: 'glyphicon glyphicon-refresh'\n            },\n            fields: {\n\n                    CompanyID: {\n                        validators: {\n                            notEmpty: {\n                                message: \"You must define the Company that this person is associated with\"\n                            }\n                        }\n                    },\n                    PropertyID: {\n                        validators: {\n                            notEmpty: {\n                                message: \"You must define the Property that this Person is associated with\"\n                            }\n                        }\n                    }\n\n\n            }\n        });\n\n$('.selectpicker').selectpicker();\n</div>\n```\n\nAs stated above, the Continue button invokes :\n\n``` javascript\n$('#mainform').formValidation('validate');\n```\n\nWhen it does I get the error message\n\nTypeError: $message is undefined :\n\n```\n$allErrors   = $message.find('.' + this.options.err.clazz.split(' ').join('.') + '[data-' + ns + '-validator][data-' + ns + '-for=\"' + field + '\"]'),\n```\n"},"comment":{"url":"https://api.github.com/repos/formvalidation/support/issues/comments/363770747","html_url":"https://github.com/formvalidation/support/issues/243#issuecomment-363770747","issue_url":"https://api.github.com/repos/formvalidation/support/issues/243","id":363770747,"user":{"login":"diadys","id":3128073,"avatar_url":"https://avatars3.githubusercontent.com/u/3128073?v=4","gravatar_id":"","url":"https://api.github.com/users/diadys","html_url":"https://github.com/diadys","followers_url":"https://api.github.com/users/diadys/followers","following_url":"https://api.github.com/users/diadys/following{/other_user}","gists_url":"https://api.github.com/users/diadys/gists{/gist_id}","starred_url":"https://api.github.com/users/diadys/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diadys/subscriptions","organizations_url":"https://api.github.com/users/diadys/orgs","repos_url":"https://api.github.com/users/diadys/repos","events_url":"https://api.github.com/users/diadys/events{/privacy}","received_events_url":"https://api.github.com/users/diadys/received_events","type":"User","site_admin":false},"created_at":"2018-02-07T13:37:16Z","updated_at":"2018-02-07T13:37:16Z","author_association":"NONE","body":"Hi,\r\n\r\nmay I add a comment on this issue if somebody else if fighting against this.\r\nIt is mandatory to instanciate a linked typeahead before create form validation instance.\r\n\r\nCheers.\r\n"}}
{"actor":{"display_login":"diadys"}}