busterkika Posted May 19, 2008 Report Share Posted May 19, 2008 Boa tarde pessoal... Estou a procurar um codigo em javascript que, tento 4 inputs e 1 checkbox, ao pressionar na checkbox me bloqueie 3 desses inputs e me copie o conteudo do 4 input para dentro dos outros 3 que foram desactivados. Ja andei as voltas e não consegui resolver o meu problema. Confesso que não pesco nada de javascript. Desde ja agradeço a ajuda de todos 🙂 Link to comment Share on other sites More sharing options...
cyclop Posted May 19, 2008 Report Share Posted May 19, 2008 já tens alguma coisa feita? "Quando eu for grande quero ser como o Celso" Link to comment Share on other sites More sharing options...
vitortomaz Posted May 20, 2008 Report Share Posted May 20, 2008 registar um método no evento de click na checkbox <input type="checkbox" value="Simula um clique" onclick="metodoClick()"> e no método fazer as afectações function metodoClick(){ //fazer qq coisa } http://vitortomaz.blogspot.com/ Link to comment Share on other sites More sharing options...
NCS_One Posted May 21, 2008 Report Share Posted May 21, 2008 Boas. Experimenta isto : <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Teste</title> <script language="JavaScript"> function honclick(CB) { if (CB.checked == true) { var Text1 = document.getElementById("t1").value; for (var aa = 2; aa < 5; aa++) { var El = document.getElementById("t"+aa); El.value = Text1; El.disabled = true; } } else { for (var aa = 2; aa < 5; aa++) { var El = document.getElementById("t"+aa); El.value = ""; El.disabled = false; } } } </script> </head> <body> <input type="text" id="t1" /> <input type="text" id="t2" /> <input type="text" id="t3" /> <input type="text" id="t4" /> <input type="checkbox" onclick="honclick(this)" /> </body> </head> </html> Se a vida te voltar as costas aproveita e apalpa-lhe o cu. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now