Salve ragazzi,
sto realizzando una tesserina per gestire il pin.
Ho 4 caselle di testo, dove due di esse diventano degli "*" e vanno gestiti solo due caselle di testo che contengono un numero solo.
Ora sto realizzando un controllo che quando valorizzo la prima casella di testo, il focus va in quella libera, dove non c'è l'asterisco.
Questo è il mio codice:
ora questo codice funziona solo quando mi trovo nella terza textbox e metto il numero, e passa in automatico nella quarta casella.Codice PHP:function gestFocus()
{
var T1 = document.getElementById("T1");
var T2 = document.getElementById("T2");
var T3 = document.getElementById("T3");
var T4 = document.getElementById("T4");
if (T1.className != "fakeLabel")
{
if (T1.value >= 1)
{
if (T2.className != "fakeLabel")
{
T2.focus();
}
}
if (T1.value >= 1)
{
if (T3.className != "fakeLabel")
{
T3.focus();
}
}
if (T1.value >= 1)
{
if (T4.className != "fakeLabel")
{
T4.focus();
}
}
}
if (T2.className != "fakeLabel")
{
if (T2.value >= 1)
{
if (T3.className != "fakeLabel")
{
T3.focus();
}
}
if (T2.value >= 1)
{
if (T4.className != "fakeLabel")
{
T4.focus();
}
}
}
if (T3.className != "fakeLabel")
{
if (T3.value >= 1 )
{
if (T4.className != "fakeLabel")
{
T4.focus();
}
}
}
}
Sapete illuminarmi in cosa sbaglio?
grazie

Rispondi quotando