mam taki problem:
mam formularz gdzie jest pole na podanie numeru GG, i chodzi mi o to, że ktoś może nie wpisywać tam nic, ale jak już podaje to żeby sprawdziło poprawności (czyli, że muszą być same cyfry) i jeżeli jest niepoprawny to żeby wyświetliło w "alercie" tekst "niepoprawny numer GG". Wie ktoś jak to zrobić ?
Inne 2 pola zrobiłem obowiązkowe i zastosowałem taki skrypt:
Kod
<SCRIPT LANGUAGE="JavaScript">
<!--
function checkform ( form )
{
if (form.nick.value == "") { alert( "Podaj swój pseudonim" );
form.nick.focus(); return false; } else
if (form.tresc.value == "") { alert( "Wpisz tre¶ć wypowiedzi" );
form.tresc.focus(); return false; }
return true;
}
//-->
</SCRIPT>
<!--
function checkform ( form )
{
if (form.nick.value == "") { alert( "Podaj swój pseudonim" );
form.nick.focus(); return false; } else
if (form.tresc.value == "") { alert( "Wpisz tre¶ć wypowiedzi" );
form.tresc.focus(); return false; }
return true;
}
//-->
</SCRIPT>
ktoś wie jak rozbudować ten skrypt dodając to co opisałem wyżej ?
pozdrawiam