0
How should I proceed with logic?
There is a Data Registration Form on the page, to know:
- Name
- Surname
- Age
- Cellular
I need to leave these fields as follows:
1- When the tab is loaded the field Surname, Age and Cellular should be disabled
2- When click on and fill in the next field below should be enabled
3- And so on, for the rest, being successively
Finally, when all the fields are filled in, the button will appear submit
.
NOTE - When the form receives the event
submit
return all fields [name, surname, age and mobile phone] to be inaccessible.
To get an Introductory Idea
function Inibe() {
document.formulario.T1.disabled = true;
}
function Exibe() {
document.formulario.T1.disabled = false;
}
<form name="formulario">
<p align="center">
<input type="text" name="T1" size="20" onload="Inibe()"></p>
<p align="center">
</p>
<p align="center">
</p>
<p align="center">
<input type="radio" name="a" onClick="Exibe()" value="1">Habilita</p>
<p align="center">
<input type="radio" name="a" onClick="Inibe()" value="2" checked>Desabilita</p>
<p align="center">
</p>
</form>
One way to do this would be to: 1) set the minimum number of characters for each field 2) count the characters at the time they are typed 3) If the quantity is equal or higher enables the next field, otherwise not. Languages: javascript or jquery
– Wilson Rosa Gomes
@Wilsonrosagomes So Wilson, the means to validate the amount of characters within each field already held in Javascript! Now, if by chance you have a practical example in this segment could post as a response please.
– Diego Henrique