Ver Mensaje Individual
  #2 (permalink)  
Antiguo 25/10/2004, 07:01
Avatar de yoseman
yoseman
 
Fecha de Ingreso: diciembre-2003
Ubicación: Alicante (Spain)
Mensajes: 471
Antigüedad: 20 años, 5 meses
Puntos: 5
He conseguido lo de los checkbox:
Código PHP:
<script language="Javascript">
function 
noVacio() 
    { 
    var 
checkFound false;
    for (var 
counter=0counter myForm.lengthcounter++) 
        {
        if ((
myForm.elements[counter].name == "add_to_[]") && (myForm.elements[counter].checked == true)) 
            {
            
checkFound true;
            }
        }
    if (
checkFound != true
        {
        
alert ("Ha de seleccionar al menos una categoría.");
        }
    return 
checkFound;
    }
</script>
 <form name ="myForm" action="./n.html" method="post" style="font:normal 10px/10px verdana;width:300px;margin:10px;padding:10px;" >
<br/>Título del imperdible:
<br /><input type="text" name="imp_title">
<br />Descripción del imperdible:
<br /><textarea name="imp_desc"></textarea>
<br /><br /><u>Categorias a las que se agregará el imperdible</u><br />
<input type="checkbox" name="add_to_[]" value="1"> Diseño<br />
<input type="checkbox" name="add_to_[]" value="2"> Programación<br />&nbsp;&nbsp;&nbsp;&nbsp;
<input type="checkbox" name="add_to_[]" value="5"> JavaScript<br />&nbsp;&nbsp;&nbsp;&nbsp;
<input type="checkbox" name="add_to_[]" value="6"> PHP<br />&nbsp;&nbsp;&nbsp;&nbsp;
<input type="checkbox" name="add_to_[]" value="7">
 MySQL<br />
<input type="checkbox" name="add_to_[]" value="3">
Tecnología<br />
<input type="checkbox" name="add_to_[]" value="4">
xHTML y Css;
<br /><br /><input type="BUTTON" name="enviar1" class="formu" value="Enviar" onclick="if (noVacio()) {this.form.submit();}">
</form> 
A ver si consigo mezclarlo con el requerimiento de que el text y el textarea este rellenados.

Salu2 ;)
__________________
[+]
[+]