I can not call JavaScript function in textBox

0

I have the following java script function to format my date fields:

function MascaraData(data){
if(mascaraInteiro(data)==false){
    event.returnValue = false;
    }   
return formataCampo(data, '00/00/0000', event);
}

but I can not call the function in the textBox of my page

    
asked by anonymous 24.09.2014 / 19:04

2 answers

2

I solved it as follows:

onKeyUp="MascaraData(this)"
    
24.09.2014 / 22:16
0

Try this.

<input type="text" onkeypress="MascaraData();" id="TextBoxDataInicio" />



function MascaraData() {

    TextBoxDataInicio = document.getElementById("TextBoxDataInicio");
    data = TextBoxDataInicio.value;

    if (mascaraInteiro(data) == false) {
        event.returnValue = false;
    }
    TextBoxDataInicio.value = formataCampo(data, '00/00/0000', event);
}
    
24.09.2014 / 19:29