validar un form tipo radio
Publicado por cristian (2 intervenciones) el 12/04/2018 22:48:24
hola buenas, tengo un formulario de tipo radio y me gustaria que se ejecutase una funcion u otra dependiendo de la opcion que selecciones. La funcion check, no estoy seguro de que este bien definida. un saludo, gracias
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<html>
<body>
<form>
Elige un nivel<br>
<input type="radio" name="nivel" id="nivel1">Nivel 1<br>
<input type="radio" name="nivel" id="nivel2">Nivel 2
</form>
<button onclick="check()">Check "Red"</button>
<button onclick="uncheck()">Uncheck "Red"</button>
<script>
function check() {
if (document.getElementById("nivel1").checked = true){
mifuncion()
}
Valora esta pregunta


0