Thread View: pl.comp.lang.javascript
2 messages
2 total messages
Started by rafian
Tue, 01 Sep 2009 11:13
Listowanie pól formularzy vs IE8
Author: rafian
Date: Tue, 01 Sep 2009 11:13
Date: Tue, 01 Sep 2009 11:13
19 lines
1902 bytes
1902 bytes
Witam.
Mam ogromny problem, funkcja waliduje formularz, po kolei pobiera
kolejne elementy formularza i sprawdza czy dane są o.k oto kod:
function W_SprawdzWysylke(obj_form){
var form=obj_form.id;
var walidacja=true;
for(el in document.forms[form].elements){
if(document.forms[form].elements[el]===null){continue;}
var id=document.forms[form].elements[el].id;
var obj=document.getElementById(id);
if(obj===null){continue;}
//Operacje na elementach
}
}
Wszędzie mi działa ten kod, mozilla, chrome, opera w ie8 - nie.
CompanionJS w IE8 pokazuje błąd: Nieprawidłowy argument linia 7 (var
obj=document.getElementById(id);)
Ja nie zauważam, żadnego błędu, proszę o pomoc.
Re: Listowanie pól formularzy vs IE8
Author: Mariusz Chwalba
Date: Tue, 01 Sep 2009 12:20
Date: Tue, 01 Sep 2009 12:20
17 lines
1247 bytes
1247 bytes
On Tue, 01 Sep 2009 13:13:25 +0200, rafian <ronin.rs@gmail.com> wrote: [...] > var id=document.forms[form].elements[el].id; > var obj=document.getElementById(id); Bez całości to zgadywanka ze szklaną kulą, ale nie chodzi Ci przypadkiem o: var obj = document.forms[form].elements[el]; var id = obj.id; Twój zapis może się wysypać gdy element do którego się dostajesz nie ma identyfikatora. pozdrawiam, -- Mariusz 'koder' Chwalba
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