Mam taki o to formularz:
CODE
<form name='f1' action='index.php5?page=insert' method='post' onsubmit="return SprawdzForme();">
<table id='male' border='0px'>
<tr><td>Nick*: </td> <td><small id="small_nick">Wymagana ilość znaków: min - 5, max - 30</small></td> <td><input type='text' name='nick' maxlength='30'></td></tr>
<tr><td>Imie*: </td> <td><small id="small_imie">Wymagana ilość znaków: min - 3, max - 30</small></td> <td><input type='text' name='imie' maxlength='30'></td></tr>
<tr><td>Nazwisko: </td> <td><small id="small_nazwisko">Wymagana ilość znaków: min - 3, max - 30</small></td> <td><input type='text' name='nazwisko' maxlength='30'></td></tr>
<tr><td>* Wymagane pola</td><td><input onsubmit="return SprawdzForme();" type='submit' value='Stworz konto'></td></tr>
</table>
</form>
CODE
<head>
<script type='text/javascript'>
/* <![CDATA[ */
function SprawdzForme() {
var x=0;
//nick maxlength 30 min 5
if (document.forms.f1.nick.value.length < 5) {
ZmienKolor("small_nick", "red");
x++;
}
else {
ZmienKolor("small_nick", "black");
}
//sprawdzanie ile jest bledow w formularzu
if (x > 0) {
return false;
}
else {
return true;
}
function ZmienKolor(id, kolor) {
var e=document.getElementById(id);
if (e <> NULL) {
e.style.color=kolor;}
}
}
/* ]]> */
</script>
</head>
Wszystko grało póki nie dodałem funkcji ZmienKolor(id, kolor). Jeżeli ją wyciągne z tagów <script> i włożę w osobne tagi <script> to wtedy funkcja ZmienKolor(id, kolor) nie jest odnajdywana (sprawdzałem w debuggerze mozilli).<script type='text/javascript'>
/* <![CDATA[ */
function SprawdzForme() {
var x=0;
//nick maxlength 30 min 5
if (document.forms.f1.nick.value.length < 5) {
ZmienKolor("small_nick", "red");
x++;
}
else {
ZmienKolor("small_nick", "black");
}
//sprawdzanie ile jest bledow w formularzu
if (x > 0) {
return false;
}
else {
return true;
}
function ZmienKolor(id, kolor) {
var e=document.getElementById(id);
if (e <> NULL) {
e.style.color=kolor;}
}
}
/* ]]> */
</script>
</head>
Aha jak chce wrzucić skrypt poprzez <script type="text/javascript" src="xxx"> to również nie mogę używać funkcji tak wrzuconych

Bardzo proszę o pomoc i z góry dziękuję
