471,881 Members | 1,304 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,881 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 1313
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

Post your reply

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

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.