Dynamically hide/show a button
543312Jan 5 2007 — edited Jan 5 2007I am trying to dynamically hide/show a button when another button is pressed.
i.e. when button ALAdd is clicked, button ALSubmit will show.
I have the javascript function below that works. I used the ID="xxx" in the button attribute field for the specified buttons.
function HideShowButton(ButtonLab)
{
var b=document.getElementById("ALSubmit");
if (ButtonLab = "ALAdd")
{
b.style.visibility = "visible";
}
}
However, the problem is that the button ALAdd is an add row to tabular form button and no matter what I put in the button attribute for onClick, It seems to get over written when the javascript for the pages is generated. If I call the function from the onMouseOver event, it works great.
i.e. If I put onClick="HideShowButon('ALAdd')" in the button attribute field,
when I look at the page source I see the following:
onclick="javascript:this.disabled=true; doSubmit('ADD');"
Is there any way to extent the onClick event?
Or
Can I create a Button the runs my function from the onClick event and somehow have the HideShowButton() function call the "Add rows to tabular form" process?
This way the button will first make button ALSubmit visible, then run the "Add rows to tabular form" process.
Or
Is there any other way to make a button visible/hidden when another button is pressed?