Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [JavaScript]Sprawdzanie formularza
marcio
post
Post #1





Grupa: Zarejestrowani
Postów: 2 291
Pomógł: 156
Dołączył: 23.09.2007
Skąd: ITALY-MILAN

Ostrzeżenie: (10%)
X----


Witam mam taki kod js:
Kod
function error_input(id,lenght,error) {

if(document.forms.reg.login.value.length < lenght) document.getElementById(id).innerHTML = error; else document.getElementById(id).innerHTML = "";
}


Oczywiscie sprawdzam wszystko tez za pomoca php jednak mam pytanie chce to zautomatyzowac zeby byl 3 argument np input_name ktory bedzie zastepowal nazwe input'a ktory ma byc sprawdzany, chodzi mi o to zeby tutaj: document.forms.reg.login.value.length wartosc login byla zmieniana za pomoca argumentu funkcji kombinowalem juz cos ale nic.
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
nospor
post
Post #2





Grupa: Moderatorzy
Postów: 36 559
Pomógł: 6315
Dołączył: 27.12.2004




Kod
document.forms.reg[input_name].value.length
Go to the top of the page
+Quote Post

Posty w temacie


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

 



RSS Aktualny czas: 11.10.2025 - 03:12