Just-validate icon indicating copy to clipboard operation
Just-validate copied to clipboard

errorContainer, doesn't work.

Open alihs opened this issue 3 years ago • 5 comments

The field for 'errorContainer' doesn't work. There is no mention of if it in the js as well.

alihs avatar Jul 05 '22 12:07 alihs

Hey, have you checked this example? https://just-validate.dev/examples/#errors-container Just in case it's called errorsContainer, not errorContainer

horprogs avatar Jul 05 '22 15:07 horprogs

Yeah I'm having similar issues - no matter how I configure the script, the error message stubbornly inserts into directly before the closing tag.

As best as I can tell, it should be possible to add to each addRule block a config setting that tells the script to add error text into a specific DIV inside the markup, but that doesn't happen. I don't really like the presentation of the tooltip, but it's the only way to currently get the error message anywhere near the erroring input.

Rocketpilot avatar Jul 22 '22 04:07 Rocketpilot

Could you please provide any example? I created a small one here and it works properly.

https://codesandbox.io/s/just-validate-template-forked-4yf98v?file=/index.html

image

horprogs avatar Jul 22 '22 11:07 horprogs

But now it's not possible to specify the error container for the each particular field. Only for everything together. Yeah it's a good point actually to make it possible, thanks. I'll look into that

horprogs avatar Jul 22 '22 11:07 horprogs

But now it's not possible to specify the error container for the each particular field. Only for everything together. Yeah it's a good point actually to make it possible, thanks. I'll look into that

Yes that's the scenario I'm talking about - an addition like that would make this an extremely versatile tool.

Rocketpilot avatar Jul 24 '22 06:07 Rocketpilot

I'm facing the same issue. An error container for each rule is much more ideal.

jpeszleny avatar Aug 22 '22 18:08 jpeszleny

Sorry guys, as it turned out I implemented the support for the custom error container for the particular field a long time ago, just forgot about it. Documentation was misleading, fixed it. The correct name of the config: errorsContainer. It works both for the globally defined and field-by-field.

You could check it out here: https://codesandbox.io/s/just-validate-template-forked-gj11bj?file=/index.html and here https://just-validate.dev/examples/#errors-container

horprogs avatar Aug 22 '22 18:08 horprogs

Sorry guys, as it turned out I implemented the support for the custom error container for the particular field a long time ago, just forgot about it. Documentation was misleading, fixed it. The correct name of the config: errorsContainer. It works both for the globally defined and field-by-field.

You could check it out here: https://codesandbox.io/s/just-validate-template-forked-gj11bj?file=/index.html and here https://just-validate.dev/examples/#errors-container

Perfect! Works great! Thanks!

jpeszleny avatar Aug 22 '22 19:08 jpeszleny