-
Notifications
You must be signed in to change notification settings - Fork 0
/
checkbox-javascript.html
executable file
·63 lines (53 loc) · 1.59 KB
/
checkbox-javascript.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<!-- <!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>lala</title>
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script>
$(document).ready(function(){
$('#button').click(function(){
if($('input[name=conditions]').is(':checked')){
alert('La politica de privacidad ha sido aceptada');
return true;
}
else{
alert('Debe aceptar la politica de privacidad');
return false;
}
});
});
</script>
</head>
<body>
<form method="post">
<input type="checkbox" name="conditions" id="conditions" /><br/>
<input type="submit" name="Enviar" id="button" value="Enviar" />
</form>
</body>
</html> -->
<script languaje="javascript">
function habilita(form)
{
form.intereses[0].disabled = false;
form.intereses[1].disabled = false;
form.intereses[2].disabled = false;
}
function deshabilita(form)
{
form.intereses[0].disabled = true;
form.intereses[1].disabled = true;
form.intereses[2].disabled = true;
}
</script>
El Formulario...
<form name="ejemplo1">
¿Desea suscribirse a nuestro boletín de novedades? <br>
<input type="radio" name="boletin" value="si" checked onClick="habilita(this.form)"> SI, quiero suscribirme.
<input type="radio" name="boletin" value="no" onClick="deshabilita(this.form)"> No, gracias.
<br><br>
Seleccione los temas de su interés:<br>
<input type="checkbox" name="intereses" value="Arte y Cultura"> Arte y Cultura<br>
<input type="checkbox" name="intereses" value="Ciencia">Ciencia<br>
<input type="checkbox" name="intereses" value="Música">Música<br>
</form>