Closed isAlmogK closed 8 years ago
I'm sorry about the issue you are having. The error messages should indeed show up at the same place.
I imagine you are changing the error message selector somehow? Can you provide that code?
The html is straightforward it might the template or bootstrap
<div class="col-lg-3">
<br>
<label class="control-label" for="food-type">{{mf "foodType" "Food Type"}}</label>
<br>
<select style="width: 100%" id="food-type" name="food-type" data-parsley-group="step1" required>
<option></option>
</select>
</div>
So it looks like it's only happening to the select2 dropdowns I'm guessing that's causing the issue. I tried setting a custom UI but it did not help
data-parsley-class-handler="#custom-parsley-error"
<span id="custom-parsley-error"></span>
I'd very much like to know the source of the change.
BTW, which is the latest "stable" version you are referring to?
I'm using 2.1.3 but also tested it out with 2.2.0-rc1 same issue, been trying to debug from what I can tell ul element is always above the select2 element
Quantity is a regular text input it's fine there but Quality is a select2 dropdown
Oh, ok, I'm happy to see there's no change between 2.1 and 2.2, that's what I was worried about.
What's the old version you were using that was putting the error where you wanted it?
Any way to know the actual DOM hierarchy around that <select>
(before and after)?
Verson v2.0.5 was fine and did not have this issue
Looking at the Changelog, you'll see that "Error containers are created only the first time they are needed". It's likely that the lib you're using for your select is loaded after Parsley. In 2.0, the error container was created, then the lib was modifying the <select>
, but now the error container is created afterwards and that doesn't give you the result you want?
A quick way to check if that's the case: with 2.0.x, change the load order of your select library and parsley. If I'm right, then you'll probably need to tweak the error selector for these kinds of inputs.
That might be the issue as I'm using Meteor but I can't change the order select2 is loaded is there any other way to fix this how can I modify the error selector?
Mmm, looks like errors-container
is not documented. It can be a jQuery selector, or a function returning a jQuery set of where to insert the error wrapper. To use the function, you have to set the option via JS, for example:
$('.my-input').parsley().options.errorsContainer = function(instance) { return $('...') }
What's the status on this?
Just updated to the lastest stable version of Parsley.JS and the biggest change that I'm now getting in my app is that the error message are now above my input fields any reason why this is happening with the latest version