Where is the HTML form property 'required'?

I’m discovering Anvil.
Anvil is so great!
I’m so used to HTML and JS, Id like to be able to inject some sometimes :slight_smile:

What I’m trying to do:
Getting a basic form checker for 'categories", to fix the tutorial about adding users (News Articles extension).
Because currently in the tutorial, a user not adding a category at article addition still writes it to the table and breaks the homepage (it can’t get an empty category).

What I’ve tried and what’s not working:
I’ve searched in the doc and forum.
I’ve cloned Form Validation and I published it as library, but it doesn’t appear as my project in the list of dependencies.
I’ve read Form_checker module but it doesn’t show which module should be added.

Code Sample:

from form_checker import validation

It’s not clear where form_checker is from, is there a list of internal and external modules somewhere?

Clone link:
my result: IJW5X7EFVBEEJPE3

And the clone of form_checker from docs: PTAJKHIEY7ROV3CO
By default, it contains a non-existing dependy to NO3OAVMMQMDJUVPE, is it the form_checker module of the form_checker tutorial project?

Just an additional noob question: Shouldn’t form checker be a checkbox in any field property?
in plain HTML it’s just a word in input: <input ... required/>

Final edit: “a new user can’t add more than two links”, well, it’s not really spam protection and I had to remove links in this post.

Thank you

For what it’s worth, here’s an alternative version of the tutorial project with validation that fixes the issue you found:

Also, form_checker is the “Package Name” of the dependency.

(I don’t know enough to answer your question about the required HTML property.)

Thank you very much @hugetim !

1 Like