Connecting Tech Pros Worldwide Help | Site Map

my Javascript wont work on Firefox!!

  #1  
Old June 1st, 2006, 06:59 PM
Newbie
 
Join Date: Jun 2006
Posts: 2
The javascript works perfect on IE, but on firefox it doesnt.


I've pasted both frames source, as well as the page source ( the right frame source.txt was zipped to fit the maximum size allowed)

the combobox on the left frame doesnt work ( should extract the items from my db )
when i pick an item on the left frame and go to "add" on the right frame i doesnt work, same when i go to the top frame to hit "validate"
In short THERE IS A PROBLEM !!

I tried to follow the standards while building the jsp, and never tought of eventual problems when moving to firefox

in brief, multiple frames in Firefox need to be treated differently and i have absolutely no clue what should be changed for my script to work on FF.

I'm pretty sure It's something small and stupid, but i just couldn't get myself to look in the right direction probably.

I'll appreciate all the help i can get
Attached Files
File Type: txt page source.txt (730 Bytes, 127 views)
File Type: txt left frame source.txt (7.1 KB, 165 views)
File Type: zip right frame source.zip (5.5 KB, 79 views)

Last edited by 9DeT; June 1st, 2006 at 07:26 PM.
  #2  
Old June 5th, 2006, 11:47 AM
Banfa's Avatar
AdministratorVoR
 
Join Date: Feb 2006
Location: South West UK
Posts: 6,117
Provided Answers: 6

re: my Javascript wont work on Firefox!!


There are a number of problems, however I suggest that you start by
  1. Correcting your DOCTYPE to a valid one, see here for a list but I think you want
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. Correcting you HTML so that it is valid for the DOCTYPE you are referencing, I suggest using the W3C HTML Validator here
  3. The whole page seemed to start working a lot better when I removed the css

    body
    {
    -moz-user-focus: ignore;
    -moz-user-input: disabled;
    -moz-user-select: none;
    }
  4. Although you have posted a lot of your code you have not posted it all. CSS, image and javascript files are missing as well as the top frame. If you are still having trouble then I suggest you post a URL for the page as we can down load any parts we need to look at once we have the URL (assuming it is available). Particularly if you have a Javascript problem then leaving the javascript file out of the post is not a good idea.
  #3  
Old June 7th, 2006, 10:43 AM
Newbie
 
Join Date: Jun 2006
Posts: 2

re: my Javascript wont work on Firefox!!


tahnk you for the feedback banfa

i've uploaded the page
URL:

http://www.spread-it.com/dl.php?id=5...41566dae86e1b2
  #4  
Old June 7th, 2006, 12:52 PM
Banfa's Avatar
AdministratorVoR
 
Join Date: Feb 2006
Location: South West UK
Posts: 6,117
Provided Answers: 6

re: my Javascript wont work on Firefox!!


Now that is a complicated app, it's hard, well impossible actually for me to provise very specific help given that this clearly runs off a database and other sever side stuff I have no access to.

However I suggest that you trying running in FireFox with the Javascript Console up as this will give you clues to what the problem is, for instance I get the error

Error: document.getElementById(idField) has no properties
Source File: file:///C:/Documents%20and%20Settings/bross/My%20Documents/html/Desktop/test_files/controller_data_003/controller_002.htm
Line: 14

That line of code is the first line of the function

Expand|Select|Wrap|Line Numbers
  1. function get(idField, nameField ){
  2.     document.getElementById(idField).value = parent.projectFrame.getTaskID()
  3.     document.getElementById(nameField).innerHTML = parent.projectFrame.getTaskName()
  4.     modified = 1
  5. }
  6.  
That function is being invoked in the html

[html]
<a href="javascript:get('task_am_1', 'name_am_1');"><img src="controller_data_002/fill.gif" border="0" height="16" width="16"></a>
[/html]

so get is trying to access an element with an id of task_am_1. However on your page there is no element with that id, I assume the element you are trying to refer to is

[html]
<input name="task_am_1" value="" style="height: 18px; width: 70px;" type="text">
[/html]

However this element is only named, not id. Perhaps you need to write this (and all the others as

[html]
<input id="task_am_1" value="" style="height: 18px; width: 70px;" type="text">
[/html]

Using ids and getElementById is more standard than using names and relying on document.<name> but if you really need the name then id and name the element

[html]
<input id="task_am_1" name="task_am_1" value="" style="height: 18px; width: 70px;" type="text">
[/html]
Reply