473,549 Members | 2,733 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Running javascript on Mozilla 1.0.1

109 New Member
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 1443
gits
5,390 Recognized Expert Moderator Expert
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 New Member
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="JavaS cript">function checkChecked() {
var len = del_frm.element s.length; var index=0;
for(index=0;ind ex<len;index++)
{ if(del_frm.elem ents[index].name=='select_ file')
{ if(del_frm.elem ents[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="webfold er2.cgi" onsubmit="retur n checkChecked()" method=post>
<input type="checkbox" name="select_fi le" 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 Recognized Expert Expert
Might not be a solution but this:
<SCRIPT language="JavaS cript">
is supposed to be:
<script type="text/javascript">
May 24 '07 #4
skyy
109 New Member
Might not be a solution but this:
<SCRIPT language="JavaS cript">
is supposed to be:
<script type="text/javascript">

Thanks... but that is not the problem...
May 24 '07 #5
gits
5,390 Recognized Expert Moderator Expert
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 New Member
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 New Member
I got another weird question...

when i create a textarea like the code below,

<textarea rows="5" cols="19" readonly style="color:re d;">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 Recognized Expert Moderator Expert
I got another weird question...

when i create a textarea like the code below,

<textarea rows="5" cols="19" readonly style="color:re d;">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 New Member
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

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

Similar topics

2
5323
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 <script language="JScript"> <!-- function Kontrolle() { var WshNetwork = new ActiveXObject("WScript.Network"); var vDomain =...
3
1422
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
1506
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 = 0 // 0 - don't show; 1 - show var showToday = 1 // 0 - don't show; 1 - show var imgDir = "images/" // directory for images ... e.g. var...
7
9583
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 language="JavaScript"> var cntlName; var eleTarget = document.getElementById('hiding'); function showOrHide(){
0
7524
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7960
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7475
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7812
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6048
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3501
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3483
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1061
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
766
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.