Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [JavaScript] problem z value.match
escobar1983
post
Post #1





Grupa: Zarejestrowani
Postów: 198
Pomógł: 0
Dołączył: 31.01.2008

Ostrzeżenie: (0%)
-----


Witam. Robie walidacje numerow telefonow w js i mam taki kod
Kod
if(telefon!='')
    {
        var retel=/^([0-9]{2})+\s*([0-9]{3})+\s*([0-9]{3})+\s*([0-9]{3})+\s*([0-9]{3})$/;
        var tel1=telefon.substr(0,14);
       var check1=tel1.value.match(retel);
if(!check1)
        {
            document.getElementById('eror_tel').innerHTML = '<font color="#ff0000"> 48 123 456 789 </font>';
            blad='tak';
          alert(blad);  
        }

}


Bład jaki sie pokazuje to "tel1.value is undefined"
No i to nie chodzi. Moze ktos mi podpowie co jest nie tak. Z góry dziekuje



Ten post edytował escobar1983 8.11.2009, 20:58:27
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 19.08.2025 - 16:09