Sunday, November 29, 2009

Javascript: problem getting values from option boxes under FireFox (works fine in IE), different syn

My function call looks like this (spaces printed and %26lt; changed to | so



yahoo doesn't censor the code):



|input type="button" on Click = " javascript : lookup



document . getElementById ('parentbox2') ,



document. getElementsByTagName ('pagingmax') .



options [ document. getElementsByTagName('pagingmax'). selectedIndex]. value ) "



|/input|



This work fine (calls the function and runs it properly) under IE



but not Firefox (Firefox won't even run the function at all).



In fact Firefox's javascript debugger claims the options and selectedindex properties do not exist!



But, of course, I want to make my code cross-browser compatible.



Any ideas?



Javascript: problem getting values from option boxes under FireFox (works fine in IE), different syntax?microsoft windows xp





I'd bet it's the field parentbox2.



name and ID are pretty much equivalent in IE.. but in firefox they are not.



so if parentbox2 doesn't have an id, it just won't work.



Javascript: problem getting values from option boxes under FireFox (works fine in IE), different syntax?ie 7 internet explorer



hi



try to put a function in stead of using the code directely



that's will be ok



bye for now
Both



document.getElementsByName



and



document.getElementsByTagName



both return arrays not elements (getElements not getElement).



so looking at your code I would have expected



document.getElementsByName ('pagingmax') [0].



Try this anyway and see.
Oracle Interview questions and answers-



http://oracleqa2.blogspot.com/



Oracle tutorial-



http://oracletutorials.blogspot.com/.......



java architecture tutorial



http://java3.blogspot.com/



sap architecture tutorial



at



http://sap1.blogspot.com/

No comments:

Post a Comment

 
web hosting talk