473,404 Members | 2,114 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

Selected Index not working on Safari browser 5.1.7, works fine in IE...

Expand|Select|Wrap|Line Numbers
  1. var elementObj = document.getElementById('code');
  2. alert("hi");
  3. var elementIndex = elementObj.selectedIndex;
  4. alert("hello");
For the above code, any cod after the selectedIndex line does not execute on Safari browser 5.1.7

Please help, or provide an alternative...
Feb 13 '13 #1

✓ answered by shravan88k

I used getElementsByName.. and it works now :)

6 2364
Dormilich
8,658 Expert Mod 8TB
what HTML element is the one with said ID?

since any code after that doesn’t execute, there should be a message in the error console. (I stab a guess at "elementObj is null or not an object")
Feb 13 '13 #2
it is a dropdown box... but the same code works fine on IE.... is getElementByID invalid on Safari Browser?
Feb 14 '13 #3
TypeError: 'null' is not an object (evaluating 'elementObj.selectedIndex')
Feb 14 '13 #4
Dormilich
8,658 Expert Mod 8TB
I guess you call it before that element is fully loaded.
Feb 14 '13 #5
I used getElementsByName.. and it works now :)
Feb 14 '13 #6
acoder
16,027 Expert Mod 8TB
I know you've solved this problem, but it'd be interesting to see your HTML code. I have a suspicion that you were trying to access the drop-down element with name "code" and no ID...
Feb 14 '13 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Foreman | last post by:
Using ASPFileUpload (http://support.microsoft.com/default.aspx?scid=kb;en-us;299692) and works for IE6 and FireFox but not Safari. Thanks in advance for your assistance.
4
by: Paul W | last post by:
Hi - can someone point me to info on the issues/resolutions of supporting the safari browser? To help me understand, if I was developing pages in say FrontPage, what attributes would I set for...
5
by: Bill Cohagan | last post by:
I'm having some serious difficulties with my ASP.Net 2.0 app rendering in Safari 2.0.3. The most immediate problem is that the menu control doesn't seem to work at all, particularly the use of...
1
by: tony dong | last post by:
Hi There After I developed portal application, it is working very well in IE browser, but it is not working using firefox, safari browser etc. The problem is the web part drag and drop...
1
by: aghymike | last post by:
Hello, this is my first post. www.michaelaghy.com I recently designed my website using Dreamweaver 8 and some Fireworks. I tested the site with Firefox and IE and it works fine but (at a...
0
by: AdrianG | last post by:
Hi there, Does ASPSmartUpload work with the MacOSX Safari browser? One of my clients uses the Safari browser and the upload never works. The scripts work fine with IE and FireFox. Thanks
0
by: uninvitedm | last post by:
I'm making a JSP page where (ideally) you select files to upload, each selected file is added to a listbox. The form is submit, (along with some other parameters), and the files are uploaded. They...
3
by: smartic | last post by:
I'm having problem with this code in firefox but in the Internet Explorer Browser works fine on it what is the wrong in my code ? <html> <head> <title>Like_mail</title> <script...
3
by: gsuns82 | last post by:
Hi all, The following code is not working properly in Mac os/safari browser. function newWindow(){ window.open('<jstl_core:url...
13
by: SwapnilD | last post by:
I'm working for a website which uses cookies to store the logged in user's information. i.e. When user log-in, if he has a valid login/password we create cookies for the UserID,CustID and etc..to be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.