SitePoint Sponsor |
|
User Tag List
Results 1 to 11 of 11
-
Oct 27, 2003, 16:25 #1
- Join Date
- May 2001
- Location
- Indiana
- Posts
- 166
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
My javascript is not working in OSX
Hi all,
http://www.xplicitonline.com/gil/select_entity.php
I am trying to get this javascript to work in OSX. It works fine on Windows machines, but when it comes to someone pulling it up on an Apple machine, nothing (whether its Safari or IE).
Could anyone offer any advice here?looking for an Independent Sales Rep...NeedARep
Michiana's Premier Online Destination- MichianaOnline
Michiana's Premier Auction Site- AuctionMichiana
-
Oct 27, 2003, 16:33 #2
- Join Date
- Apr 2002
- Location
- Sydney, Australia
- Posts
- 173
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I'm not too sure about Safari, but try this. I notice you give your form elements a name like
<input type="text" name="firstName" />
What you should do is to add another attribute called id.
<input type="text" name="firstName" id="firstName" />
And in your javascript, refer to the element by
document.getElementById("firstName").value
That should do it. What's the difference between name and id? If you wanna find out let me know and I'll post a reply (too lazy to type it out now!).
Let me know if that works for you.
-
Oct 27, 2003, 16:36 #3
- Join Date
- May 2001
- Location
- Indiana
- Posts
- 166
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Jason, do you think this is attributed to why it would work in Windows and not in a Mac machine?
looking for an Independent Sales Rep...NeedARep
Michiana's Premier Online Destination- MichianaOnline
Michiana's Premier Auction Site- AuctionMichiana
-
Oct 27, 2003, 21:29 #4
- Join Date
- May 2001
- Location
- Indiana
- Posts
- 166
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Can anyone help me with this problem? Please?
looking for an Independent Sales Rep...NeedARep
Michiana's Premier Online Destination- MichianaOnline
Michiana's Premier Auction Site- AuctionMichiana
-
Oct 27, 2003, 21:44 #5
- Join Date
- May 2003
- Posts
- 1,843
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Can't see your original source (you changed it); but this:
Code:document.myform.getElementById(package).length;i++)
Code:for (var i=0; i < document.getElementById('package').length;i++) { if (document.getElementById(package)[i].checked)
package
Java word; definately reserved in JavaScript. Lose it immediately, and try again. if still broken, post the url.Last edited by adios; Oct 27, 2003 at 22:10.
::: certified wild guess :::
-
Oct 27, 2003, 22:04 #6
- Join Date
- Apr 2002
- Location
- Sydney, Australia
- Posts
- 173
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
You should also refer to it as
document.getElementById("fmFirstName")
-
Oct 28, 2003, 05:13 #7
- Join Date
- May 2001
- Location
- Indiana
- Posts
- 166
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Adios, I tried your suggestion and now its not even working on PC...what could I be doing wrong?
looking for an Independent Sales Rep...NeedARep
Michiana's Premier Online Destination- MichianaOnline
Michiana's Premier Auction Site- AuctionMichiana
-
Oct 28, 2003, 06:42 #8
- Join Date
- Apr 2002
- Location
- Sydney, Australia
- Posts
- 173
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Gloryzone... post your code online so I can have a look to see what's wrong.
Basically, you should do this...
document.getElementById("fmFirstName").value or document.getElementById("fmFirstName").length
and so on and so on...
-
Oct 28, 2003, 10:37 #9
- Join Date
- May 2003
- Posts
- 1,843
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Gloryzone... post your code online so we can all have a look to see what's wrong.
::: certified wild guess :::
-
Oct 28, 2003, 13:39 #10
- Join Date
- Mar 2002
- Location
- Manchester, UK
- Posts
- 853
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
From the code:
Code:if(state==""){}else{ var package=0;
As a result of those variables, many browsers will be discarding the entire javascript functions/code blocks containing them. That wipes out an awful lot of your code.
Originally Posted by gloryzone
IE/windows is very forgiving. Sometimes, you can make a colossal mistake and IE/win will just gloss over it, without telling you. You page is broken, but IE managed to figure it out somehow, and won't reveal that there's a problem. Other browsers (including IE/Mac) go down in flames. This could be one of those cases.gav
http://www.livejournal.com/users/blufive/
browser stats analysis and comment:
http://www.livejournal.com/community/stats_weenie/
-
Oct 30, 2003, 15:52 #11
- Join Date
- May 2001
- Location
- Indiana
- Posts
- 166
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
blufive, thank you for that detailed explanation.
I was wondering if you could PLEASE help me out by examining the code that I have there now and see if you could modify the code on there for me so that I can get it working. I am not a programmer, I simply own the website that it is to be used on. Four people told me they could help me with the problem and lo and behold, it is still happening. I could email you the page also, if you wish. Thank you again for the detailed answer to my question.
gillooking for an Independent Sales Rep...NeedARep
Michiana's Premier Online Destination- MichianaOnline
Michiana's Premier Auction Site- AuctionMichiana
Bookmarks