Jump to content


Jorge Serrão

Member Since 23/04/2009
Offline Last Active 15/06/2009, 19:16
-----

Posts I've Made

In Topic: Ajuda Em Formulário[resolvido]

05/05/2009, 11:52

Aqui vai uma ajuda!

Adapte para o que vc necessita!

<html>
	<head>

		<title> Empresas </title>

		&lt;script>

			function verificaEmpr(emp){

				var div = document.getElementById('div'+ emp.id);

				if (emp.checked == true)
					div.style.display = 'block';
				else
					div.style.display = 'none';
			}

		</script>

		<style>

			.cl_est{
				margin-top: 20px;
				margin-left: 50px;
				display: none;
			}

		</style>

	</head>

	<body>

		<form id="frm1" name="nm_frm1">

			<div>
				<input type="checkbox" id="ea" name="nm_ea" onClick="verificaEmpr(this);" />
				Empresa A
			</div>

			<div class="cl_est" id="divea">
				<input type="checkbox" id="a1" /> Estabelecimento A1 <br />
				<input type="checkbox" id="a2" /> Estabelecimento A2 <br />
				<input type="checkbox" id="a3" /> Estabelecimento A3 <br />
				<input type="checkbox" id="a4" /> Estabelecimento A4 <br />
			</div>

			<br />

			<div>
				<input type="checkbox" id="eb" name="nm_eb" onClick="verificaEmpr(this);" />
				Empresa B
			</div>

			<div class="cl_est" id="diveb">
				<input type="checkbox" id="b1" /> Estabelecimento B1 <br />
				<input type="checkbox" id="b2" /> Estabelecimento B2 <br />
				<input type="checkbox" id="b3" /> Estabelecimento B3 <br />
				<input type="checkbox" id="b4" /> Estabelecimento B4 <br />
			</div>

			<br />

			<div>
				<input type="checkbox" id="ec" name="nm_ec" onClick="verificaEmpr(this);" />
				Empresa C
			</div>

			<div class="cl_est" id="divec">
				<input type="checkbox" id="c1" /> Estabelecimento C1 <br />
				<input type="checkbox" id="c2" /> Estabelecimento C2 <br />
				<input type="checkbox" id="c3" /> Estabelecimento C3 <br />
				<input type="checkbox" id="c4" /> Estabelecimento C4 <br />
			</div>

		</form>

	</body>

</html>



Muito Obrigado pela ajudinha.

Resolveu o meu Problema

IPB Skin By Virteq