Foros del Web » Programando para Internet » Javascript »

Checkbox Obligatorio (protección datos)

Estas en el tema de Checkbox Obligatorio (protección datos) en el foro de Javascript en Foros del Web. Puede echarme alguien un cable para conseguir que el checkbox funcione como obligatorio, me tiene . Gracias de antemano. function MM_preloadImages() { //v3.0 var d=document; ...
  #1 (permalink)  
Antiguo 10/05/2011, 12:17
 
Fecha de Ingreso: mayo-2011
Mensajes: 1
Antigüedad: 13 años
Puntos: 0
Checkbox Obligatorio (protección datos)

Puede echarme alguien un cable para conseguir que el checkbox funcione como obligatorio, me tiene . Gracias de antemano.

function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function verificarCasilla(form)
{
if (lopd.aceptoppdp.checked == false)
{
alert("Debes aceptar los términos del contrato antes de continuar");
form.aceptoppdp.focus(); return false;
}
form.submit()
}
function MM_validateForm() { //v4.0
var i,p,q,nm,test,num,min,max,errors='',args=MM_valida teForm.arguments;
for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
if (val) { nm=val.name; if ((val=val.value)!="") {
if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
if (p<1 || p==(val.length-1)) errors+='- '+nm+' incorrecto.\n';
}
else if (test!='R') { num = parseFloat(val);
if (isNaN(val)) errors+='- '+nm+' erroneo.\n';
if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
min=test.substring(8,p); max=test.substring(p+1);
if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' es necesario.\n'; }
} if (errors) alert('Error en los datos:\n'+errors);
document.MM_returnValue = (errors == '');
}

//-->
</script>

<form action="/formmail/cgi-bin/FormMail.pl" method="POST" name="fpedro" id="fpedro" onsubmit=
"MM_validateForm('Nombre','','R','Apellido','','R' ,'Empresa','','R','Telefono','','RisNum','email',' ','RisEmail','Texto','','R');return document.MM_returnValue">
<label><span class="Estilo60">Nombre:<br />
<input name="Nombre" type="text" id="Nombre" size="30" maxlength="25" />
</span></label>
<span class="Estilo60">
<label><br />
Apellido/s:<br />
<input name="Apellido" type="text" id="Apellido" size="30" maxlength="25" />
<br />
</label>
<label>Empresa:<br />
<input name="Empresa" type="text" id="Empresa" size="30" maxlength="50" />
<br />
Teléfono:<br />
<input name="Teléfono" type="text" id="Telefono" size="30" maxlength="25" />
<br />
</label>
<label>E-mail:<br />
<input name="E-mail" type="text" id="email" value="@" size="30" maxlength="30" />
</label>
<label><br />
Texto:<br />
<textarea name="Texto" cols="50" rows="8" id="Texto"></textarea>
</label>
<label> </label>
</span>
<label> <br />
<input name="lopd" type="checkbox" id="casillalopd" value="aceptoppdp" />
<a href="aviso-legal.html" class="Estilo60">Acepto la Pol&iacute;tica de Protecci&oacute;n de Datos Personales</a>.<br />
<span class="Verificacion">Verificación: ¡Si puede leer esto, no rellene el siguiente campo!</span><br />
<input name="Verificacion" type="text" class="Verificacion" size="30" />
<br />
<br />
</label>
<input name="Submit" type="submit" onclick="MM_validateForm('Nombre','','R','Apellido ','','R','Empresa','','R','Telefono','','RisNum',' email','','RisEmail','Texto','','R');return document.MM_returnValue" value="Enviar" />
<input type="hidden" name="recipient" value="[email protected]" />
<input type="hidden" value="Formulario enviado por WEB" name="subject" />
<input type="hidden" name="redirect" value="http://www.terra.es" />
</form>
  #2 (permalink)  
Antiguo 10/05/2011, 12:30
Avatar de zeuslife  
Fecha de Ingreso: enero-2008
Ubicación: Madrid
Mensajes: 533
Antigüedad: 16 años, 3 meses
Puntos: 11
Respuesta: Checkbox Obligatorio (protección datos)

Creo que esto te valdrá: http://www.forosdelweb.com/f13/valid...ulario-739640/

Saludos!
__________________
Neversyn Software e Ingeniería

Etiquetas: checkbox
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 10:37.