ki_ko Posted May 6, 2008 at 06:35 PM Report Share #183651 Posted May 6, 2008 at 06:35 PM pessoal tou com este codigo numa pagina <script type="text/javascript"> function toggleVisibility(){ if (document.getElementById("Calendar1").style.visibility=="hidden"){ document.getElementById("Calendar1").style.visibility=="visible"; } else { document.getElementById("Panel_calendario").style.visibility=="hidden"; } } </script> depois um botao <input type="button" id="Button1" runat="server" value="..." class="text" onclick="toggleVisibility()"/> mas isto ta sempre a dar erro na pagina, alguem me pode dizer o que fiz de mal? Link to comment Share on other sites More sharing options...
djthyrax Posted May 6, 2008 at 06:44 PM Report Share #183654 Posted May 6, 2008 at 06:44 PM Quando defines o estado, é = e não ==. Não peças ajuda por PM! A tua dúvida vai ter menos atenção do que se for postada na secção correcta do fórum! Link to comment Share on other sites More sharing options...
ki_ko Posted May 6, 2008 at 06:46 PM Author Report Share #183656 Posted May 6, 2008 at 06:46 PM 🙂 ja alterado . mas continua a não funcionar. Link to comment Share on other sites More sharing options...
djthyrax Posted May 6, 2008 at 06:48 PM Report Share #183657 Posted May 6, 2008 at 06:48 PM function toggleVisibility(){ if (document.getElementById("Calendar1").style.visibility=="hidden"){ document.getElementById("Calendar1").style.visibility="visible"; } else { document.getElementById("Calendar1").style.visibility="hidden"; } } Alterei o último id. Não peças ajuda por PM! A tua dúvida vai ter menos atenção do que se for postada na secção correcta do fórum! Link to comment Share on other sites More sharing options...
ki_ko Posted May 6, 2008 at 06:50 PM Author Report Share #183659 Posted May 6, 2008 at 06:50 PM pois mas nao funciona. mais alguma ideia? será no botão? Link to comment Share on other sites More sharing options...
djthyrax Posted May 6, 2008 at 06:54 PM Report Share #183660 Posted May 6, 2008 at 06:54 PM Não, é o id que está mal. Troca Calendar1 por Panel_calendario (digo eu). Não peças ajuda por PM! A tua dúvida vai ter menos atenção do que se for postada na secção correcta do fórum! Link to comment Share on other sites More sharing options...
ki_ko Posted May 6, 2008 at 06:55 PM Author Report Share #183661 Posted May 6, 2008 at 06:55 PM nao funciona. ja tentei Link to comment Share on other sites More sharing options...
jsWizard Posted May 6, 2008 at 09:26 PM Report Share #183693 Posted May 6, 2008 at 09:26 PM viva! cuidado que o JavaScript é CaSe SeNsItIvE!! .. e o DOM também!! por isso.. Calendar1 é != de calendar1. não quer dizer que seja disso.. mas este código funciona! <html> <head> <script language="JavaScript"> function toggleVisibility(){ if(document.getElementById("Calendar1").style.visibility == "hidden"){ document.getElementById("Calendar1").style.visibility="visible"; }else{ document.getElementById("Calendar1").style.visibility="hidden"; } } </script> </head> <body> <div id="Calendar1">mostra e esconde!</div> <input type="button" value="teste" onclick="JavaSCript:toggleVisibility();" /> </body> </html> Masssssssss... pode muito bem ser do " runat="server" " ....... o que faz com que a página procure o método toggleVisibility() do lado do servidor. por isso.. apaga o " runat="server" ". inté! Link to comment Share on other sites More sharing options...
ki_ko Posted May 6, 2008 at 10:30 PM Author Report Share #183705 Posted May 6, 2008 at 10:30 PM mesmo assim da erro na pagina!!!! Link to comment Share on other sites More sharing options...
ki_ko Posted May 6, 2008 at 10:33 PM Author Report Share #183706 Posted May 6, 2008 at 10:33 PM sera por o calendario ser um objecto asp ???? Link to comment Share on other sites More sharing options...
fnds Posted May 8, 2008 at 04:20 PM Report Share #183995 Posted May 8, 2008 at 04:20 PM ? o calendário tem de ser o id uma tag html. Link to comment Share on other sites More sharing options...
jsWizard Posted May 8, 2008 at 04:26 PM Report Share #183997 Posted May 8, 2008 at 04:26 PM Ki_Ko.. acho que estás com o kiko todo baralhado.. e estás a misturar código server-side com client-side.. e como é normal, "chamar" código client do lado do servidor, dá asneira.. "chamar" código server-side do lado do cliente.. dá também asneira! hehe.. 😄 inté! 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