Código PHP:
<SCRIPT>
function comprueba(formu) {
if (formu.nombre.value=="") {
alert("El campo NOMBRE está vacío.");
formu.nombre.focus();
return (false);
}
if (formu.mismo.selectedIndex=="2") {
if (formu.nombre2.value=="") {
alert("El campo NOMBRE de Datos de Envío está vacío.");
formu.nombre2.focus()
return (false);
}
}
return(true);
}
</SCRIPT>
<form action="pagina.asp" name="form" onSubmit = "return comprueba(this);" method="post">
<tr>
<th scope="row">Nombre:</th>
<td> <input name="nombre" type="text"></td>
</tr>
<tr>
<th scope="row" colspan="2">Datos de Envío.<br>
<input name="mismo" type="radio" onClick="desbloquea(this.form)" value="1" checked>Diferentes de Datos de Facturación<br>
<input name="mismo" type="radio" onClick="bloquea(this.form)" value="2">Coincidentes con Datos de Facturación.</th>
</tr>
<tr>
<th scope="row">Nombre de envío:</th>
<td> <input name="nombre2" type="text"><br><input type="submit" name="juas" value="Aceptar"></td>
</tr>
<tr></form>