473,394 Members | 1,774 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,394 software developers and data experts.

Running javascript on Mozilla 1.0.1

109 100+
Hi i got some cgi scripts running on the http server which uses javascript also..

It works well with ie6.. but when i try it on mozilla, the scripts got no response. Some scripts it gives out error such as "form1 not defined"
May 23 '07 #1
12 1436
gits
5,390 Expert Mod 4TB
Hi i got some cgi scripts running on the http server which uses javascript also..

It works well with ie6.. but when i try it on mozilla, the scripts got no response. Some scripts it gives out error such as "form1 not defined"
please, post some js-code from where the error occurs ... you may also use a firefox and the firebug-extension to debug your scripts ...

kind regards ....
May 23 '07 #2
skyy
109 100+
please, post some js-code from where the error occurs ... you may also use a firefox and the firebug-extension to debug your scripts ...

kind regards ....
Hi... here are the code...

<SCRIPT language="JavaScript">function checkChecked() {
var len = del_frm.elements.length; var index=0;
for(index=0;index<len;index++)
{ if(del_frm.elements[index].name=='select_file')
{ if(del_frm.elements[index].checked==true)
{ confirmSubmit(); return true;
}} }
alert("Please select a file/folder to delete"); location.href="webfolder.cgi";
return true;}

<form name="del_frm" id="del_frm" action="webfolder2.cgi" onsubmit="return checkChecked()" method=post>
<input type="checkbox" name="select_file" value="example" id="checkbox">
</form>


This checkChecked() js function works well with ie6.. when i try to do it with mozilla 1.0.1 it does not work..
looking at the javascript console:
Error : del_frm is not defined

Any idea?
May 24 '07 #3
drhowarddrfine
7,435 Expert 4TB
Might not be a solution but this:
<SCRIPT language="JavaScript">
is supposed to be:
<script type="text/javascript">
May 24 '07 #4
skyy
109 100+
Might not be a solution but this:
<SCRIPT language="JavaScript">
is supposed to be:
<script type="text/javascript">

Thanks... but that is not the problem...
May 24 '07 #5
gits
5,390 Expert Mod 4TB
hi ... the problem is the reference you use for the form, that is ie-way ... you should always prefer the standard w3c-way to refer to nodes in the document, so try the following:

Expand|Select|Wrap|Line Numbers
  1. function checkChecked() {
  2.     // at first include this statement in your script that
  3.     // refers the form the standard-compliant way
  4.  
  5.     var del_frm = document.getElementById('del_frm');
  6.  
  7.     // ... your code here
  8. }
  9.  
hope this helps ;) and
kind regards ...
May 24 '07 #6
skyy
109 100+
hi ... the problem is the reference you use for the form, that is ie-way ... you should always prefer the standard w3c-way to refer to nodes in the document, so try the following:

Expand|Select|Wrap|Line Numbers
  1. function checkChecked() {
  2.     // at first include this statement in your script that
  3.     // refers the form the standard-compliant way
  4.  
  5.     var del_frm = document.getElementById('del_frm');
  6.  
  7.     // ... your code here
  8. }
  9.  
hope this helps ;) and
kind regards ...
Hi gits.. Thanks alot.. this really helps! Thanks!
May 24 '07 #7
skyy
109 100+
I got another weird question...

when i create a textarea like the code below,

<textarea rows="5" cols="19" readonly style="color:red;">C:$ls_dir</textarea>


ie6 gives me a text area with vertical scroll bar while mozilla give me a horizontal scroll bar. Any way to fix it? Thank!
May 24 '07 #8
gits
5,390 Expert Mod 4TB
I got another weird question...

when i create a textarea like the code below,

<textarea rows="5" cols="19" readonly style="color:red;">C:$ls_dir</textarea>


ie6 gives me a text area with vertical scroll bar while mozilla give me a horizontal scroll bar. Any way to fix it? Thank!
try to set overflow: auto to the style ... then scrollbars appear when they are needed ...

kind regards
May 24 '07 #9
skyy
109 100+
try to set overflow: auto to the style ... then scrollbars appear when they are needed ...

kind regards
Hi.. How do you do that? can provide me an example?

Thanks!
May 24 '07 #10
gits
5,390 Expert Mod 4TB
using your example:

Expand|Select|Wrap|Line Numbers
  1. <textarea rows="5" cols="19" readonly style="color:red; overflow:auto;">C:$ls_dir</textarea>
  2.  
kind regards ...
May 24 '07 #11
skyy
109 100+
using your example:

Expand|Select|Wrap|Line Numbers
  1. <textarea rows="5" cols="19" readonly style="color:red; overflow:auto;">C:$ls_dir</textarea>
  2.  
kind regards ...
Hi thanks for the help. but that doesnt work..

I want the textarea to have only vertical scroll bar only for all browser.

Tried overflow-y:scroll; overflow-x:hidden..

Ie6 works fine but mozilla shows horizontal scroll bar...
May 25 '07 #12
gits
5,390 Expert Mod 4TB
Hi thanks for the help. but that doesnt work..

I want the textarea to have only vertical scroll bar only for all browser.

Tried overflow-y:scroll; overflow-x:hidden..

Ie6 works fine but mozilla shows horizontal scroll bar...
overflow-x, -y are ie specific .. but have a look at this thread:

http://www.thescripts.com/forum/thread440530.html
May 25 '07 #13

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

Similar topics

2
by: Christoph | last post by:
The following script works fine on two Webservers in the internet, but it doesn't work on my local Webserver (Xitami). I also tried the IIS, with the same result - the script isn't forwarding me ...
3
by: Charlie | last post by:
Hi: What technologies are available in ASP.NET for running Server side code from a JavaScript function? Thanks, Charlie
1
by: rajesh | last post by:
var fixedX = -1 // x position (-1 if to appear below control) var fixedY = -1 // y position (-1 if to appear below control) var startAt = 0 // 0 - sunday ; 1 - monday var showWeekNumber =...
7
by: Coder | last post by:
Hi I have the following code in java script, it is not giving proper output in FIREFOX but running fine in IE... can anybody help me out to make this run in FIREFOX . <script...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.