Jump to content


Photo

Ativar Input Com Checkbox Habiltado


  • Faça o login para participar
3 replies to this topic

#1 Robsons Brasil

Robsons Brasil

    Novato no fórum

  • Usuários
  • 5 posts
  • Sexo:Não informado

Posted 13/05/2009, 14:38

Boa tarde,

Tem esse fonte e gostaria de saber como habilitar os inputs que são criados dinâmicamente, lembrando que as propiedades nome e o id do input é do tudo (nome[id][NomeDoInput]), o id são pegos do banco. O exemplo abaixo funciona somente para o id=9. Gostaria de saber como passar os id automaticamente para quando eu clicar no checkbox ele habilitar ou desabilitar os inputs.

Agradeço amigos!!


<html>
<head>
<script>
	function HabiDsabi()
	{
		 if(document.getElementById('habi').checked == true){
			 document.getElementById('envia').disabled = ""
			 document.getElementById('txtNOME').disabled = ""
		 }
		 if(document.getElementById('habi').checked == false){
			 document.getElementById('envia').disabled = "disabled"
			 document.getElementById('txtNOME').disabled = "disabled"
		 }
	}

	function dasabilitar()
	{
		 if(document.getElementById('exame[9][checkbox]').checked == true){
			 document.getElementById('exame[9][txtDATAREALIZACAO]').disabled = ""
		 }
		 if(document.getElementById('exame[9][checkbox]').checked == false){
			 document.getElementById('exame[9][txtDATAREALIZACAO]').disabled = "disabled"
		 }
	}
</script>

</head>

<body>
<form name="form1">
<input type="checkbox" name="habi" id="habi" onClick="HabiDsabi()">
<input type="text" name="txtNOME" id="txtNOME" disabled>
<input type="button" name="envia" id="envia" value="Enviar" disabled>
<br /><br />
<input type="checkbox" name="exame[9][checkbox]" id="exame[9][checkbox]" onClick="dasabilitar()">
<input type="text" name="exame[9][txtDATAREALIZACAO]" id="exame[9][txtDATAREALIZACAO]" disabled>
<input type="text" name="exame[11][txtDATAREALIZACAO]" id="exame[11][txtDATAREALIZACAO]" disabled>
</form>
</body>

</html>


#2 Alex Hiroshi

Alex Hiroshi

    Super Veterano

  • Ex-Admins
  • 4923 posts
  • Sexo:Masculino
  • Localidade:São Paulo - SP

Posted 15/05/2009, 16:47

Será criado um checkbox para cada campo ou apenas um checkbox vai desabilitar/habilitar todos os campos?
Fórum WMO - Equipe de Desenvolvimento / Banco de Dados - Ex-Administrador

#3 Miguceamma

Miguceamma

    MiguPenjisse

  • Usuários
  • 13201 posts

Posted 06/11/2017, 02:10

Pastilla Cialis Alcohol Priligy 30 Mg Precio Espana vardenafil bestellen buy accutane forum Drug Buy Motilium
Buy Propecia In London Zithromax Out Of Date Viagra Apotheke Zurich viagra Candianpharmacies

#4 JeffMalm

JeffMalm

    Super Veterano

  • Usuários
  • 12254 posts
  • Sexo:Feminino
  • Localidade:Mount Carey

Posted 13/02/2023, 06:02

Treatment of acne keloidalis nuchae a systematic review of the literature stromectol 12mg tablets
That broken piece of wood is worth at most one silver coin, and what about Liposuction Lower Blood Pressure Soul Binding levitra generique en pharmaceutique
Perioperative effects of melatonin and midazolam premedication on sedation, orientation, anxiety scores and psychomotor performance tamoxifen class Total RNA was isolated and analyzed as previously described 44




1 user(s) are reading this topic

0 membro(s), 1 visitante(s) e 0 membros anônimo(s)

IPB Skin By Virteq