Código HTML:
<SCRIPT LANGUAGE="JavaScript"> function validar(){ var count = 0; var counted =0; var i =0; for (i=0; i<document.frmPaises.paises[i].length; i++){ if (document.frmPaises.paises[i].checked==true){ count += parseFloat(document.frmPaises.lolori[i].value); alert (gilipoyas); if (count > document.frmPaises.total.value){ alert ("No puedes fotocopiar más de " + document.frmPaises.total.value +" páginas"); document.frmPaises.paises[i].checked=0; }else{ var parent = document.getElementById( 'finally' ); parent.innerHTML="<div>" + count +"</div>"; var dest = document.getElementById('jamon') dest.value = count } } } if(count == 0){ var parent = document.getElementById( 'finally' ); parent.innerHTML="<div>0</div>"; } } function validar2(){ frmPaises.submit(); } </SCRIPT>
Código PHP:
$control = 1;
while ($conlibros > 0){
$tamano= mysql_query("SELECT tamano FROM librosfotocopias where nomlibro = '$titulolibro' ORDER BY IDCO DESC LIMIT 0,$conlibros");
$contini = mysql_query("SELECT contenido FROM librosfotocopias where nomlibro = '$titulolibro' ORDER BY IDCO DESC LIMIT 0,$conlibros");
while( $array_datos = mysql_fetch_row($contini) ){
foreach ( $array_datos as $contini12 ){
}
}
while( $array_datos = mysql_fetch_row($tamano) ){
foreach ( $array_datos as $tamano12 ){
}
}
$contini99 = mysql_query("SELECT pagina FROM librosfotocopias where nomlibro = '$titulolibro' ORDER BY IDCO DESC LIMIT 0,$conlibros");
while( $array_datos = mysql_fetch_row($contini99) ){
foreach ( $array_datos as $conitni15 ){
}
}
echo" <tr>
<td><font size='2'>".$contini12."</font></td>
<td width='24'><font size='2'>".$conitni15."</font></td>
<td width='20'><label><input type='checkbox' name='paises".$control."' value ='".$contini12."' onClick='validar()'><input type='hidden' name='lolori' value ='".$tamano12."' /></label></td>
</tr>";
$conlibros--;
$prey = $prey+1;
$control++;
document.frmPaises.paises has no properties
http://www.daepc.org/fotocopias02.php
Line 45
GlbOBJDTToolbar.g_ComboBox.setAttribute is not a function
http://www.daepc.org/fotocopias02.php
Line 45
La línea 45 es:
for (i=0; i<document.frmPaises.paises[i].length; i++){
Gracias!!