Estou tentando passar um valor para as variaveis através de um script que verifica se estah checado determinado checkbox, se estiver checado … recebe o valor 01… Mas não está dando certo … Serah q alguem pode me dar uma luz? Segue código abaixo:
Código:
<%@ page contentType=“text/html; charset=iso-8859-1” language=“java” import=“java.sql.*” errorPage="" %>
<html>
<head>
<title>Documento sem título</title>
<meta http-equiv=“Content-Type” content=“text/html; charset=iso-8859-1”>
</head>
<link href=“principais.css” rel=“stylesheet” type=“text/css”>
if (Form1.gravidade[1].checked== true){
(’<%= leve = “”%>’);
(’<%= grave = “01”%>’);
(’<%= fatal = “”%>’);
return(false);
}
if (Form1.gravidade[2].checked== true){
(’<%= leve=""%>’);
(’<%= grave = “”%>’);
(’<%= fatal = “01”%>’);
return(false);
}
Form1.submit();
}
</script>
<form name="Acidentes" method="post" OnSubmit="return checa_form(this);" action="consuta_teste.jsp">
<p>
<input name="gravidade" type="checkbox" value="<%= leve %>">
Leve<br>
<input name="gravidade" type="checkbox" value="<%= grave%>">
Grave <br>
<input name="gravidade" type="checkbox" value="<%= fatal%>">
Fatal<br>
</p>
<input name="pesquisar" type="submit" id="pesquisar2" value="Pesquisar" class="button">
<%
out.print("Leve = “+leve);
out.print(” - Grave = “+grave);
out.print(” - Fatal = "+fatal);
%>
</form>
Grata
Carla
