Thread View: pl.comp.lang.java
1 messages
1 total messages
Started by Mariusz Jasinski
Fri, 25 Apr 1997 20:03
JavaScript - Spacje
Author: Mariusz Jasinski
Date: Fri, 25 Apr 1997 20:03
Date: Fri, 25 Apr 1997 20:03
30 lines
1510 bytes
1510 bytes
Chcę sprawdzić, czy tekst ma same spacje, czy nie?
I mam taką funkcję, która ma zwrócić true, jeśli
tekst jest pusty lub ma tylko spacje. Jeśli tekst
ma jakieś konkretne znaki, to funkcja zwraca false.
Jaki jest tutaj błąd:
function test_pole(pole) {
if (pole.value == "")
return true
else
{
tablica = pole.value.split(" ");
if (tablica.length == 0)
{
alert("Wpisz dane w polach oznaczonych kropka!");
return true;
}
else
return false;
}
}
--
|''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''|
Mariusz Jasinski mailto:jasinski@ci-1.ci.pwr.wroc.pl
WWW HomePage http://www.ci.pwr.wroc.pl/~jasinski
Droga do Delphi http://www.ci.pwr.wroc.pl/~cieslak/Delphi/
Adres pocztowy ul. Wittiga 4/603, 51-628 Wroclaw
|..............................................................|
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads