We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When using required=true on type radiobuttons the browser does not show a hint and does not prevent submitting.
Instead a jsonform error is created. I would expect a hint and that it does not submit until a selection is taken.
How to reproduce:
{ "schema": { "name": { "title": "Name", "type": "string", "required": true }, "birthdate": { "type": "string", "title": "Birth date", "required": true }, "q1": { "type": "string", "title": "Question", "enum": [ "yes", "no" ], "required": true } }, "form": [ { "key": "name", "type": "text" }, { "key": "q1", "type": "radiobuttons", "activeClass": "btn-success" }, { "key": "birthdate", "type": "date" }, { "type": "submit", "title": "Submit" } ] }
Using jquery-3.5.1, bootstrap v4.4.1 and latest underscore.js and jsonform.js, jsv.js from jsonform repo.
<script src="/static/js/jquery-3.5.1.min.js" ></script> <script src="/static/js/bootstrap.bundle.min.js"></script> <script src='/static/js/underscore-min.js'></script> <script src='/static/js/jsv.js'></script> <script src='/static/js/jsonform.js'></script> <style> .jsonform-required>label:after { content: ' *'; color: red; } .btn-default { color: #343a40; background-color: transparent; background-image: none; border-color: #343a40; } </style>
The text was updated successfully, but these errors were encountered:
Some steps forward. I figured out that I need a CSS class to display the error with the radiobuttons.
.error { border: 2px solid red; border-radius: .25rem; }
The hint is only displayed when the other fields are correctly filled out. And it still creates a jsonform error, where the others do not.
Sorry, something went wrong.
Funny, the activeClass is used on the header above the buttons when you click it. Test it in the official demo.
activeClass
Hi @bluepuma77
Thanks for your report. I'm not entirely sure why this happens but I think it may be related to input group validation on the bootstrap side (https://getbootstrap.com/docs/4.5/components/forms/#validation); What do you think ?
No branches or pull requests
When using required=true on type radiobuttons the browser does not show a hint and does not prevent submitting.
Instead a jsonform error is created. I would expect a hint and that it does not submit until a selection is taken.
How to reproduce:
Using jquery-3.5.1, bootstrap v4.4.1 and latest underscore.js and jsonform.js, jsv.js from jsonform repo.
The text was updated successfully, but these errors were encountered: