-1
I created a registration page for the java function to match the "/" symbol. example by typing 20 java engaged "/" => 20/ typing 2 more digits => 20/12/ filtering to the standard date 20/13/2017 . but after typing the month nothing happened. what’s wrong ?
<font color="orange" size="4">Data:<font><p></p>
<input type="text" required maxlength="10" id="data" onkeyup="datajs()" placeholder="dia/mes/ano" />
<script>
function datajs(){
data = document.getElementById("data").value;
var dia = data.substr(0,2);
var mes = data.substr(2,3);
var ano = data.substr(5,4);
var data1 = data.substr(2,1);
var data2 = data.substr(5,1);
if (data1 != "/") {
if( data.length >= 3 ) {
if( data.length <= 4 ) {
document.forms[0].data.value = dia+'/'+mes;
}
}
}
if(data2 != "/") {
if( data.length > 5 ) {
if( data.length <= 10 ) {
document.forms[0].data.value = dia+mes+'/'+ano;
}
}
}
}
</script>
<style>
#data {
Difficult to understand the question. Elaborate better.
– Murillo Goulart