I’ve 2 radiobuttons and one input text. What i have to do is depending on the radiobutton selected, the text box has to change the onkeypress info.
what i’ve got so far is
[CODE]function swapForm(tipo) {
var objects = document.getElementsByTagName(“INPUT”);
for (var i=0; i<objects.length; i++) {
var thisElement = objects[i];
if (thisElement.getAttribute(“type”) != “text”) continue;
if (tipo==’processo’){
thisElement.title = (‘Informe o numero do Processo.’);
}
if (tipo==’documento’){
thisElement.title = (‘Informe o numero do Documento.’);
}
}
}
i’d like to include there for [B]tipo==’processo’ onkeypress=”return formataQualquerTipoMascara(document.forms[0],’Processo’,’999.999/9999-9′, event);”
and for [B] tipo==’documento’ onkeypress=”return formataQualquerTipoMascara(document.forms[0], ‘Documento’, ‘999999-9’, event);”
how can i do that?
thanks.