So it sounds like you’re trying to validate the value the user types in, and prevent them from proceeding unless a proper value is present. That does not require custom HTML, just validation code.
In the simplest version, you just check the value present before you do something with it, and prevent the action if the value isn’t correct. For example, for a field that must have something in it, you could use:
if not self.inputfield.text:
alert("You must type something in")
return
# take the action
It obviously gets more complicated than that, but you could do all your validation in the same way, with a series of if statements.
There are also libraries that will do validation for you, if you specify the rules. Here’s one: Yet another validator and formatter