Re: accessing dynamic generated dom element with javascript in IE
"Michel Carroll" <[email protected]>
| Newsgroups | gmane.comp.web.dom.wdf |
|---|---|
| Message-ID | <[email protected]> |
Hi, this is an incomplete code snippet and therefore not so easy to give an opinion on. Could you let us know which line IE has a problem with. Is it where you set q to be equal to one of the form elements (if ((q = myform.elements["Q_" + i]))) or where you try and get its value (if ( q.value == ""))? Michel --- In [email protected], "Sleeping Beauty" <ms_f_habib@y...> wrote: > > I a creating a site for entering tests > the instuctor can add questions whenever he needs and the question and > answer fields are appended with the questions counter > > I've created a javascript function to validate the questions > the problem is that it doesn't work in IE it worked in firefox > > this is how I access the fields > for (i=1 ; i<= counter ; i++) > { > if ((q = myform.elements["Q_" + i])) > { > > if ( q.value == "") > { > str = str + 'enter a question plz' > } > } > > } > in IE q is considered undefined! > > is there any other option, coz I need the code to work in IE > thank you > aurora > ------------------------ Yahoo! Groups Sponsor --------------------~--> Get fast access to your favorite Yahoo! Groups. Make Yahoo! your home page http://us.click.yahoo.com/dpRU5A/wUILAA/yQLSAA/9rHolB/TM --------------------------------------------------------------------~-> Unsubscribe [email protected] List info http://www.quirksmode.org/dom/list.html Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/wdf-dom/ <*> To unsubscribe from this group, send an email to: [email protected] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/