1
What would be a way to validate the text field as soon as the button is clicked?
Using only Javascript.
Ex:
If the field is not completed, and the user to click the button it emits an alert and would not let the form be sent and would show which field is blank and missing the fill.
<form>
<fieldset>
<legend>Teste</legend>
Informe seu nome: <input tpye="text" size="10">
<p>
<input type="submit" value="Validar">
</fieldset>
</form>
to put the required input in your input, and the field would be validated
– Victor
Puts a
id
in that<input>
and give an Alert for javascript. Check out this link. https://www.w3schools.com/js/js_validation.asp– Romulo Sousa
If you found the answer useful, be sure to dial ✔
– Sam