473,503 Members | 1,929 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Java Script error when browse the mozilla, uncaught error()

11 New Member
hai ,

i got an error in javascript, when upload a file in a form,

the code is working properly in IE but i got javascript error in Mozilla firefos
what is mean by error and how to rectify that.

the error is
Error: uncaught exception: [Exception... "Security error" code: "1000" nsresult: "0x805303e8 (NS_ERROR_DOM_SECURITY_ERR)" location: form1.php


here is the code
================

[HTML]<script language="javascript">

function checkform()

{
varfile = document.form1.file1.value;
if(varfile == "")
{
alert("Select a file to upload");
document.form1.file1.focus();
return false;
}

if(varfile!="")
{

varfile = document.form1.file1.value;
valfoc=document.form1.file1;
valofch=validoffile(varfile,valfoc)
if(valofch==false)
{
valfoc.focus();
return false;
}
}
varfile2= document.form1.file2.value;
if(varfile2!="")
{
varfile2 = document.form1.file2.value;
valfoc2=document.form1.file2;
valofch2=validoffile(varfile2,valfoc2)
if(valofch2==false)
{
valfoc2.focus();
return false;
}
}
}

function validoffile(valofchk,valfoc)
{

var Valu=valofchk;
var Val=Valu.toLowerCase();
var Val1=Val.indexOf('.pdf');
var Val2=Val.indexOf('.zip');

if (Val1==-1 && Val2==-1 )
{
alert('You can attach only any of .pdf, .zipextension file');
return (false);
}
}
function imposeMaxLength(Object, MaxLen)
{
return (Object.value.length < MaxLen);
}
function fnPaste(vEl)
{
var intMaxLength, intCurrLength, strClip ;
var intClipLength, intAvailLength ;
var blnReturn ;

blnReturn = true ;
intMaxLength = vEl.getAttribute("maxlength") ;
intCurrLength = vEl.value.length ;
strClip = window.clipboardData.getData("Text") ;
intClipLength = strClip.length ;
intAvailLength = intMaxLength - intCurrLength ;

if (intAvailLength > 0)
{
if (intAvailLength < intClipLength)
{
strClip = strClip.substr(0, intAvailLength) ;
window.clipboardData.setData("Text",strClip) ;
}
}
else
{
blnReturn = false ;
}
return blnReturn ;
//filesave.php
}
</script>

<form name="form1" action="#" method="post" enctype="multipart/form-data" onsubmit="return checkform()">

<table>
<tr bgcolor="#f6f4f4">
<td><div class="body" align="right">File 1</div></td>
<td><input name="file1" id="file1" class="textfieldbig" type="file" unselectable="on">
*</td>
</tr>
<tr bgcolor="#f6f4f4">
<td><div class="body" align="right">Description For File 1</div></td>
<td><textarea class="messagebox" id="textarea1" name="desfile1" onkeypress="return imposeMaxLength(this, 1500);" onpaste="return fnPaste(this);" maxlength=1500 ></textarea></td>
</tr>
<tr bgcolor="#f6f4f4">
<td><div class="body" align="right">File 2</div></td>
<td><input name="file2" class="textfieldbig" type="file" unselectable="on"></td>
</tr>
<tr bgcolor="#f6f4f4">
<td><div class="body" align="right">Description For File 2</div></td>
<td><textarea class="messagebox" id="textarea1" name="desfile2" onkeypress="return imposeMaxLength(this, 1500);" onpaste="return fnPaste(this);" maxlength=1500 ></textarea></td>
</tr>
</table>[/HTML]
Mar 3 '08 #1
3 7001
acoder
16,027 Recognized Expert Moderator MVP
What line does it occur on?
Mar 3 '08 #2
svsenthilkumar
11 New Member
What line does it occur on?

Error: uncaught exception: [Exception... "Security error" code: "1000" nsresult: "0x805303e8 (NS_ERROR_DOM_SECURITY_ERR)" location: "form123.php Line: 110"]
Mar 3 '08 #3
acoder
16,027 Recognized Expert Moderator MVP
Error: uncaught exception: [Exception... "Security error" code: "1000" nsresult: "0x805303e8 (NS_ERROR_DOM_SECURITY_ERR)" location: "form123.php Line: 110"]
Which line would that be in your code?
Mar 3 '08 #4

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

Similar topics

6
3231
by: Matt Bostock | last post by:
Hi, When I validate this page: http://www.drfunkenstein.net/using http://jigsaw.w3.org/css-validator/, I get the following results: ...
3
1969
by: André Nobre | last post by:
Hi all... How can I call a java script function when user clicks on my asp:checkbox control? It's obvious that server control events doesn't work, because it runs on server.. So, how can i...
2
1149
by: Brown Smith | last post by:
How to get the browser window properties at run time through java script code? When my ASP.Net application is launched (through IE only) I am interested with the following properties from client...
2
1889
by: naeemrz | last post by:
I have a Javascript function, which changes a text field of a form into a select field. Following is the function function changeStateField() { var myForm =...
5
13099
by: Ankur | last post by:
Hi Folks, I am new for this group. I want to clarify one thing what's a basic difference between Client Side Java Script and Server Side Java Script. how we can differentiate it. Why we called...
1
1325
by: sarath chandran | last post by:
Hi all, I am using a mozilla browser and the below piece of code appears to be erroneous.It works well with Internet explorer. Here I am getting the session id and storing it ina variable. How...
9
1693
by: Tuy Solang | last post by:
I download four scripts that are used to display Khmer PGN for Khmer Chess. It works fine with Netscape 7.1 on MS Millenium, but it gave me an error(Java Script console) with Netscape 8.1 on MS...
2
2368
by: ramanagosu | last post by:
HI everybody I am writing java script code it's working fine in IE browser and not working fine in Mozilla code: <SCRIPT LANGUAGE="JavaScript"> function verify() { var themessage =...
0
2558
by: tosreejithp | last post by:
Hi, My first problem was i am not able to compiled a file from java script to java class.Now its clear and working fine..now i can convert a java script file to java class by Rhino Java Script...
0
7192
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
7064
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
7261
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,...
1
6974
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
5559
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,...
0
4665
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3147
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
721
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
369
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...

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.