posabsolute / jQuery-Validation-Engine

jQuery form validation plugin
http://www.position-absolute.com/articles/jquery-form-validator-because-form-validation-is-a-mess/
2.57k stars 1.2k forks source link

cdn #978

Open liuanxin opened 5 years ago

liuanxin commented 5 years ago

Don't consider putting 3.1.0 on cdn?

Now the latest 2.6.4 version on cdn, there is a problem with the latest 3.4.1 version of jquery

jquery version validation-engine version status
>= 3.3.0 2.6.4 has problems
<= 3.2.1 2.6.4 good
dennybrandes commented 5 years ago

I created a MR on cdnjs and waiting to be merged. Than the latest version of jquery-validation-engine will be available on cdnjs.

https://github.com/cdnjs/cdnjs/pull/13439

dennybrandes commented 5 years ago

can you tell me the problem with latest jquery version and 2.6.4?

liuanxin commented 5 years ago

In addition, after I added the following style, a single error prompt will be output to a line(as in the above figure, * Not a valid and integer are output in two lines).

.formError { white-space: nowrap; }

In this way, the position on the upper right is consistent every time the request is made. If not, the first validate error will be slightly lower, then click on the animation to move the prompt.

Of course, I am not sure if this is intentional

liuanxin commented 4 years ago

jquery 3.4.1: https://liuanxin.github.io/version/3.4.1.html fail jquery 3.2.1: https://liuanxin.github.io/version/3.2.1.html success

$.validationEngine.defaults.scroll = false and $form.validationEngine('validate', { scroll: false }) are not in effect in query 3.2.1, { promptPosition : "topLeft" } is also, can only be used on each attribute data-prompt-position="topLeft"

It seems that the generation point of the error prompt has a problem when getting the position. The same problem is also found in the datetimepicker. The location goes to the top of the page.

@dennybrandes

dennybrandes commented 4 years ago

I tried you links but i can't see any error. Prompt is on correct position. Where can i see the bug exactly?

liuanxin commented 4 years ago

I'm sorry, I did not express clearly

I modified the code to the following

var flag = $form.validationEngine('validate', { promptPosition: "topLeft", scroll: false });
if (!flag) {
    return;
}

The final error message is still in the default position(topRight). If I want to make the error appear on the topLeft, I have to use data-prompt-position="topLeft" on each form element. image


In addition, if the first error is not in the visible area, scroll: false will not take effect, and it will still scroll. Of course, this does not take effect when validate