Foros del Web » Programando para Internet » PHP »

ayuda Column 'DNI_CIF' cannot be null

Estas en el tema de ayuda Column 'DNI_CIF' cannot be null en el foro de PHP en Foros del Web. Tengo un campo DNI obligatorio . He puesto un boton cancelar para volver atras de la pagina del formulario. Pero cuando le doy al boton ...
  #1 (permalink)  
Antiguo 08/11/2009, 03:53
 
Fecha de Ingreso: abril-2009
Mensajes: 173
Antigüedad: 15 años
Puntos: 0
ayuda Column 'DNI_CIF' cannot be null

Tengo un campo DNI obligatorio .
He puesto un boton cancelar para volver atras de la pagina del formulario.
Pero cuando le doy al boton
<input name="button" type="submit" class="box1" id="button" value="CANCELAR" onclick="window.location.href='censo.html'" />

ME SALE ESTO:Column 'DNI_CIF' cannot be null

Que puedo hacer para darle a cancelar ,si el usuario no quiere meter ningun dato en el formulario y que no me salda ese error?
gracias
  #2 (permalink)  
Antiguo 08/11/2009, 04:10
Avatar de jlmoreno31  
Fecha de Ingreso: mayo-2009
Ubicación: Barcelona
Mensajes: 174
Antigüedad: 14 años, 11 meses
Puntos: 2
Respuesta: ayuda Column 'DNI_CIF' cannot be null

Hola modatorrevieja,

Pon el form entero y vemos como lo tienes. Porque no entiendo la pregunta.

Saludos
  #3 (permalink)  
Antiguo 08/11/2009, 04:18
 
Fecha de Ingreso: abril-2009
Mensajes: 173
Antigüedad: 15 años
Puntos: 0
Respuesta: ayuda Column 'DNI_CIF' cannot be null

<table align="center">
<tr valign="baseline">
<td width="138" align="right" nowrap="nowrap">DNI_CIF:</td>
<td width="214"><input type="text" name="DNI_CIF" value="" size="15" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">PERSONA O SOCIEDAD:</td>
<td><select name="TIPO_PERSONA" size="1">
<?php
do {
?>
<option value="<?php echo $row_tipopersona['TIPO_PERSONA']?>"<?php if (!(strcmp($row_tipopersona['TIPO_PERSONA'], $row_tipopersona['']))) {echo "selected=\"selected\"";} ?>><?php echo $row_tipopersona['TIPO_PERSONA']?></option>
<?php
} while ($row_tipopersona = mysql_fetch_assoc($tipopersona));
$rows = mysql_num_rows($tipopersona);
if($rows > 0) {
mysql_data_seek($tipopersona, 0);
$row_tipopersona = mysql_fetch_assoc($tipopersona);
}
?>
</select></td>
</tr>
<tr> </tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">NOMBRE:</td>
<td><input type="text" name="NOMBRE" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">APELLIDOS:</td>
<td><input type="text" name="APELLIDOS" value="" size="32" /></td>
</tr>

<td nowrap="nowrap" align="right">DIRECCION:</td>
<td><input type="text" name="DIRECCION" value="" size="32" /></td>


<td width="83" align="right" nowrap="nowrap">COD_POSTAL:</td>
<td width="192"><input type="text" name="COD_POSTAL" value="" size="32" /></td>

<td nowrap="nowrap" align="right">LOCALIDAD:</td>
<td><input type="text" name="LOCALIDAD" value="" size="32" /></td>

<tr valign="baseline">
<td nowrap="nowrap" align="right">PROVINCIA:</td>
<td><input type="text" name="PROVINCIA" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">PAIS:</td>
<td><input type="text" name="PAIS" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">TELEF_FIJO:</td>
<td><input type="text" name="TELEF_FIJO" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">TELEF_MOVIL:</td>
<td><input type="text" name="TELEF_MOVIL" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">MAIL:</td>
<td><input type="text" name="MAIL" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">FAX:</td>
<td><input type="text" name="FAX" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">OBSERVACIONES:</td>
<td><input type="text" name="OBSERVACIONES" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">&nbsp;</td>
<td><input type="submit" class="box1" value="DAR DE ALTA" />

<input name="button" type="submit" class="box1" id="button" value="CANCELAR" onclick="window.location.href='censo.html'" />

</label></td>
</tr>
</table>
  #4 (permalink)  
Antiguo 08/11/2009, 04:20
 
Fecha de Ingreso: abril-2009
Mensajes: 173
Antigüedad: 15 años
Puntos: 0
Respuesta: ayuda Column 'DNI_CIF' cannot be null

Entro en la seccion FORMULARIO, y el usuario dice no quiero rellenarlo ,quiero volver atras con el boton cancelar, como el campo DNI_DIF es null ,si le doy a cancelar sin rellenar nada, me sale en pantalla este mensaje Column 'DNI_CIF' cannot be null y no me vuelve atras a otra pagina.
  #5 (permalink)  
Antiguo 08/11/2009, 15:48
Avatar de jlmoreno31  
Fecha de Ingreso: mayo-2009
Ubicación: Barcelona
Mensajes: 174
Antigüedad: 14 años, 11 meses
Puntos: 2
Respuesta: ayuda Column 'DNI_CIF' cannot be null

Ok. Ahora lo entiendo, yo haría esto.

<input name="button" type="button" class="box1" id="button" value="CANCELAR" onclick="window.location.href='censo.html'" />

Quita el submit y pon button. Creo que así no tendrás problemas.

Saludos
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 09:15.