![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 184 Pomógł: 13 Dołączył: 7.01.2008 Ostrzeżenie: (0%) ![]() ![]() |
Witam,
Tworzę formularz dynamicznie: Kod //formularz var objLetKnowForm = document.createElement("form"); objLetKnowForm.setAttribute('name','letknowform'); objLetKnowForm.setAttribute('method','get'); objLetKnowForm.onsubmit = function(){return false;} objLetKnow.appendChild(objLetKnowForm); //Input nadawca var objLetKnowNadawca = document.createElement("input"); objLetKnowNadawca.setAttribute('type','text'); objLetKnowNadawca.setAttribute('name','nadawca'); objLetKnowNadawca.setAttribute('value','Twój e-mail'); objLetKnowNadawca.onfocus = function () {if(this.value=='Twój e-mail') this.value=''} objLetKnowForm.appendChild(objLetKnowNadawca); //Input button var objLetKnowButton = document.createElement("input"); objLetKnowButton.setAttribute('type','submit'); objLetKnowButton.setAttribute('name','letknowbutton'); objLetKnowButton.setAttribute('value','Powiadom'); objLetKnowButton.onclick = function(){alert(document.letknowform.nadawca.value); return false;} objLetKnowForm.appendChild(objLetKnowButton); Pod FF i Operą alert zwraca zawartośc pola nadawca, natomiast IE wyświetla błąd: document.letknowform.nadawca jest pusty lub nie jest obiektem. Ktoś ma pomysł dlaczego? Pozdrawiam |
|
|
![]() ![]() |
![]() |
Wersja Lo-Fi | Aktualny czas: 19.07.2025 - 18:24 |