Click here to Skip to main content
15,905,867 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a form with two buttons:

XML
<form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true" />
        <input type="button" onclick="criarNota();" value="Criar Nota" />
        <input type="button" onclick="botaoCarregarNotas();" value="Carregar Notas" />

    </form>


But I would like that the second buttons "Carregar Notas", only appears after clicking on "Criar Nota" button.

Is that possible ?
Posted

Hi
The code will look some thing like this

XML
<form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true" />
        <input type="button" id="criarNota" onclick="criarNota();" value="Criar Nota" />
        <input type="button" id="botaoCarregarNotas" onclick="botaoCarregarNotas();" style="display:none;" value="Carregar Notas" />
    </form>



Now the Javascript function will look like

function criarNota(){
document.getElementById("botaoCarregarNotas").style.display = "block";
}

Thanks
Hope this helps
 
Share this answer
 
v3
Comments
Maxdd 7 26-Dec-10 21:35pm    
you switched the functions but that's it :)
Yes, very much possible.

First of all, define ID field for both the buttons.

Set the style:display property of button with text "Carregar Notas" as none to begin with. This would render the button on the page but keep it hidden.

Now, onclick of button with text "Criar Nota", call client side Javascript method "criarNota()"

In this method, get the other button and just set the display property to block and you are done. Try!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900