1

I tried running the code from the author to make chosen.js work with jquery validation engine

Here is the authors code

I used the same code to test, but it is not working

This is my code

jQuery(document).ready(function() {
                // binds form submission and fields to the validation engine
                jQuery("#formID").validationEngine({
                    prettySelect : true,
                    useSuffix: "_chzn"
                    //promptPosition : "bottomLeft"
        });
        $("#country").chosen({
                    allow_single_deselect : true
        });
});

Here is my fiddle

I don't know whats wrong in my code?

Nishant123
  • 1,968
  • 2
  • 26
  • 44
  • Did you try this locally and got the same error? http://stackoverflow.com/questions/18952320/shell-form-does-not-validate-jsfiddle/18952586 – denchu Jul 15 '16 at 08:58

1 Answers1

3

Answering my own question

I solved the problem by changing "_chzn" to "_chosen". Also added validateNonVisibleFields = true as chosen select hides the actual select

jQuery('#formID').validationEngine({
           validateNonVisibleFields: true, 
           prettySelect : true,
           useSuffix: "_chosen"
  });
Nishant123
  • 1,968
  • 2
  • 26
  • 44
  • Your code worked for me by removing prettySelect option. It raises javascript error field.position is undefined at line 1863 - Validation Engine 2.6.2. – Khalil Laleh Feb 24 '17 at 15:06
  • You need to provide `promptposition` either during initialization or in ` – Nishant123 Feb 25 '17 at 04:35