473,385 Members | 2,274 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,385 software developers and data experts.

Extrange error Why?

Hi:
I'm testing with fireforx 1.0 on MdkLinux10.0
I can not figure out why am I getting this error:
Error: [Exception... "'Permiso denegado para obtener propiedad
XULElement.selectedIndex' when calling method:
[nsIAutoCompletePopup::selectedIndex]" nsresult: "0x8057001e
(NS_ERROR_XPC_JS_THREW_STRING)" location: "JS frame ::
file:///home/mcanedo/Desktop/forma.html :: validar :: line 151" data: no]
Archivo Fuente: file:///home/mcanedo/Desktop/forma.html
Línea: 151

This is the code I'm working on:
<html>
<head><TITLE></TITLE>
<STYLE type="text/css">
body{background:gray;color:yellow;}
input{border-color:transparent}
..cEtiqueta{background:black;color:yellow;font-weight:bold;
border-width:1px;text-align:right;font-family:sans-serif;}
..cEditable{background:white;color:black;font-weight:bold;;border-width:1px;text-align:right;font-family:sans-serif;}
..cTitulo{background:white;color:black;font-weight:bold;border-width:1px;text-align:center;font-family:sans-serif;}
..cCodigo{background:white;color:black;font-weight:bold;border-width:1px;text-align:left;font-family:sans-serif;}
..cCantidad{background:white;color:black;font-weight:bold;border-color:transparent;border-width:1px;text-align:right;width:20pxfont-family:sans-serif;}
..cDescripcion{background:black;color:yellow;font-weight:bold;
border-width:1px;text-align:left;font-family:sans-serif;}
..cEspecial{background:white;color:red;font-weight:bold;border-width:1px;text-align:right;font-family:sans-serif;}
..cTotal
{background:white;color:red;font-weight:bold;font-size:large;border-width:1px;text-align:right;font-family:sans-serif;}
</STYLE>
<script type="text/javascript">

var vRenglones=10;

var vCodigo =new
Array(null,"FER-315","FER-330","ACM-BL","FER-CHAM","ACM-PAN","ARE-5","VSI-PAN","VSI-CHA","ALGO-COM");
var vDescripcion = new Array(null,"Fergino Mezclilla","Fergino
Gabardina","Blusa ACM","Chamarra
Fergino","ACM-PAN","ARE-5","VSI-PAN","VSI-CHA","ALGO-COM");
var vPrecio = new Array(null,315.00,330.00,270.00,420.00,200,100,50, 120,136)
var vPromocion = new
Array(null,300.00,null,250.00,null,190,90,40,null, null,null)

//variables para num2txt
var numbers = new
Array('','un','dos','tres','cuatro','cinco','seis' ,'siete','ocho','nueve','diez','once','doce','trec e','catorce','quince','dieciseis','diecisiete','di eciocho','diecinueve','veinte','veinun','veintidos ','veintires','veinticuatro','veinticinco','veinti seis','veintisiete','veintiocho','veintinueve');
var numbers10 = new
Array('','diez','veinte','treinta','cuarenta','cin cuenta','sesenta','setenta','ochenta','noventa');

function num2txt(input,texto) {
//El valor maximo es 99,000

var dollars = Math.floor(input);
var cents = Math.round((input*100 - dollars*100));

if (cents<10){
cents='0'+cents;
}

var thousands = (dollars - dollars % 1000) / 1000;
dollars -= thousands * 1000;
var hundreds = (dollars - dollars % 100) / 100;
dollars -= hundreds * 100;

var output = '';

output += (thousands > 0 ? fN(thousands) + ' mil ' : '');

switch (hundreds){
case 1:
if(dollars==0){
output += 'cien ';
}else{
output += 'ciento ';
}
break;
case 5: output += 'quinientos ';
break;
case 7: output += 'setecientos ';
break;
case 9: output += 'novecientos ';
break;
default:
output += (hundreds > 0 ? fN(hundreds) + 'cientos ' : '');
}

output += (dollars > 0 ? fN(dollars) + ' ' : '') +
((thousands > 0 || hundreds > 0 || dollars > 0) ? texto+' ' : '') +
cents + '/100';

return output.substring(0,1).toUpperCase() + output.substring(1);
}

//llamada desde num2txt
function fN(i) {
if (i<30) return numbers[i];
var tens = (i - i % 10) / 10, units = i - (i - i % 10);
return numbers10[tens] + ((tens > 0 && units > 0) ? ' y ' : '') +
numbers[units];
}

//formato numerico
function numerico(n) {
n=n*1;
var arr=new Array('0'), i=0;
while (n>0)
{arr[i]=''+n%1000; n=Math.floor(n/1000); i++;}
arr=arr.reverse();
for (var i in arr) if (i>0) //padding zeros
while (arr[i].length<3) arr[i]='0'+arr[i];
return arr.join();
}
//actualiza el renglon con el valor selecionadp
/*
function compute(form, select, indice){
var vfDes='fDes_'+indice;
var vfPrecio='fPrecio_'+indice;
var vfCantidad='fCantidad_'+indice;
var vfPromocion='fPromocion_'+indice;
var vfCodigo='fCodigo_'+indice;

document.getElementById(vfCantidad).value=1;

document.getElementById(vfDes).innerHTML=vDescripc ion[select.selectedIndex];
document.getElementById(vfPrecio).innerHTML=vPreci o[select.selectedIndex];

document.getElementById(vfPromocion).value=vPromoc ion[select.selectedIndex];
calcularRenglon(form,indice);
//se cambaia el foco excepto en el ultimo renglon
if(indice+1<vRenglones){
var vSigIndice=(indice*1)+1;
var vFCodigoSigIndice='fCodigo_'+vSigIndice;
var vFCantidadSigIndice='fCantidad_'+vSigIndice;
var vFPromocionSigIndice='fPromocion_'+vSigIndice;
document.getElementById(vFCodigoSigIndice).disable d=false;
document.getElementById(vFCantidadSigIndice).disab led=false;
document.getElementById(vFPromocionSigIndice).disa bled=false;
document.getElementById(vFCodigoSigIndice).focus() ; //verificar la ultima
y mandar al boton
}

}
*/

//actualiza el renglon con el valor selecionadp
function validar(indice){
var i;
var vfDes='fDes_'+indice;
var vfPrecio='fPrecio_'+indice;
var vfCantidad='fCantidad_'+indice;
var vfPromocion='fPromocion_'+indice;
var vfCodigo='fCodigo_'+indice;

for (i=0;i<vCodigo.length;i++){
if(document.getElementById(vfCodigo).value.toUpper Case()==vCodigo[i]){
// SI EXISTE
document.getElementById(vfCantidad).value=1;
document.getElementById(vfDes).innerHTML=vDescripc ion[i];
document.getElementById(vfPrecio).innerHTML=vPreci o[i];
document.getElementById(vfPromocion).value=vPromoc ion[i];

calcularRenglon(indice);
//se cambaia el foco excepto en el ultimo renglon
if(indice+1<vRenglones){
var vSigIndice=(indice*1)+1;
vSigIndice=vSigIndice+'';
var vFCodigoSigIndice='fCodigo_'+vSigIndice;
var vFCantidadSigIndice='fCantidad_'+vSigIndice;
var vFPromocionSigIndice='fPromocion_'+vSigIndice;
document.getElementById(vFCodigoSigIndice).disable d=false;
document.getElementById(vFCantidadSigIndice).disab led=false;
document.getElementById(vFPromocionSigIndice).disa bled=false;
document.getElementById(vFCodigoSigIndice).focus() ;
}
}
}
}
//calcula el monto del renglon indice de la forma form y el Total
function calcularRenglon(indice){
var vTotal=0;
var vfMonto='fMonto_'+indice;
var vfPrecio='fPrecio_'+indice;
var vfCantidad='fCantidad_'+indice;
var vfPromocion='fPromocion_'+indice;
if(document.getElementById(vfPromocion).value=="") {
//precio regular

document.getElementById(vfMonto).innerHTML=documen t.getElementById(vfCantidad).value*document.getEle mentById(vfPrecio).innerHTML;
}else{
//precio promocion

document.getElementById(vfMonto).innerHTML=documen t.getElementById(vfCantidad).value*document.getEle mentById(vfPromocion).value;
}

//Aqui se calcula el total
for (ren=0;ren<vRenglones;ren++){
var vfMontoI='fMonto_'+ren;
if (typeof document.getElementById(vfMontoI).innerHTML != "undefined"){
vTotal=vTotal+(document.getElementById(vfMontoI).i nnerHTML*1); //*1 para
que tome como numero
}
}
document.getElementById('fTotal').innerHTML=numeri co(vTotal*1);
document.getElementById('fTxtTotal').innerHTML=num 2txt(vTotal,'pesos');
}
</script>
</head>

<body>
<table>
<form name=fVentas method="get">
<tr>
<TD class="cTitulo">Codigo</TD>
<td class="cTitulo">Cantidad</td>
<td class="cTitulo">Descripcion</td>
<td class="cTitulo">Precio</td>
<td class="cTitulo">Especial</td>
<td class="cTitulo">Monto</td>
</tr>

<script type="text/javascript">
//escribe tal cantidad de renglones
for (i=0;i<vRenglones;i++){
//se habilita solo el primer renglon
if (i>0){
vDeshabilita='disabled';
}else{
vDeshabilita='';
}

//esto es todo un renglon de la tabla
document.write("<tr>");
document.write("<td class=\"cCodigo\"><input "+vDeshabilita+" type=\"text\"
class=\"cCodigo\" name=\"fCodigo_"+i+"\" id=\"fCodigo_"+i+"\"
onChange=\"validar("+i+")\" ></td>");
document.write("<td class=\"cCantidad\"><input "+vDeshabilita+"
type=\"text\" class=\"cCantidad\" name=\"fCantidad_"+i+"\"
id=\"fCantidad_"+i+"\" onChange=\"calcularRenglon("+i+")\" ></td>");
document.write("<td class=\"cDescripcion\" name=\"fDes_"+i+"\"
id=\"fDes_"+i+"\"></td>");
document.write("<td class=\"cEtiqueta\" name=\"fPrecio_"+i+"\"
id=\"fPrecio_"+i+"\" ></td>");
document.write("<td class=\"cEspecial\"><input "+vDeshabilita+"
type=\"text\" class=\"cEspecial\" name=\"fPromocion_"+i+"\"
id=\"fPromocion_"+i+"\" onChange=\"calcularRenglon("+i+")\" ></td>");
document.write("<td class=\"cEtiqueta\" name=\"fMonto_"+i+"\"
id=\"fMonto_"+i+"\" ></td>");
document.write("<tr>");
document.write("</tr>");
}

</script>

<tr><TD>
</TD><td>
</td><TD>
</TD><TD>
</TD><TD>Total</TD>
<TD class="cTotal" name="fTotal" id="fTotal"></TD></tr>
<tr><TD colspan=6 align=right name="fTxtTotal" id="fTxtTotal"
class="cTotal" ></TD></tr>
</table>

<tr><TD><input type="button" value="Vender" onclick="submit()"></TD></tr>

</form>
</body>
</html>
Jul 23 '05 #1
1 1402
Miguel Cañedo wrote:
Hi:
I'm testing with fireforx 1.0 on MdkLinux10.0
I can not figure out why am I getting this error:
Error: [Exception... "'Permiso denegado para obtener propiedad
XULElement.selectedIndex' when calling method:
[nsIAutoCompletePopup::selectedIndex]" nsresult: "0x8057001e
(NS_ERROR_XPC_JS_THREW_STRING)" location: "JS frame ::
file:///home/mcanedo/Desktop/forma.html :: validar :: line 151" data: no]
Archivo Fuente: file:///home/mcanedo/Desktop/forma.html
Línea: 151


To replicate error type FER-330 in the first cell.
Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: AIM | last post by:
Error in msvc in building inheritance.obj to build hello.pyd Hello, I am trying to build the boost 1.31.0 sample extension hello.cpp. I can not compile the file inheritance.cpp because the two...
5
by: Tony Wright | last post by:
Hi, I am having a problem installing an msi for a web site. The error message I am getting is: "The specified path 'http://mipdev05/features/Fas2' is unavailable. The Internet Information...
13
by: deko | last post by:
I use this convention frequently: Exit_Here: Exit Sub HandleErr: Select Case Err.Number Case 3163 Resume Next Case 3376 Resume Next
2
by: joão paulo | last post by:
I've made a class generator using CodeDom, and it is working fine, but whem i try to compile the class generated I got some CS1003 syntax errors. But terrible thing is that there isn't any...
7
by: p | last post by:
WE had a Crystal 8 WebApp using vs 2002 which we upgraded to VS2003. I also have Crystal 9 pro on my development machine. The web app runs fine on my dev machine but am having problems deploying....
1
by: gallerto | last post by:
I have a very extrange problem with calloc. I am working with Dev-C++ in Windows. Another extrange thing is that when I try to run the debugger it does not run. Only with the firstt file. I...
6
by: gallerto | last post by:
I have a very extrange problem with calloc. I am working with Dev-C++ in Windows. The code is in C but I compile it as C++. All my files are .cpp I will explain the situation. I have a program...
2
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
0
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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,...

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.