faqts : Computers : Programming : Languages : JavaScript : Forms : Buttons

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

29 of 43 people (67%) answered Yes
Recently 8 of 10 people (80%) answered Yes

Entry

How can we make a button visible at runtime

Apr 27th, 2006 05:15
Kumaran Rajakumar, jagdish jagdish,


If the button is already there in the form u can use

To hide the button:

document.getElementById("buttonId").style.display="none"; 

To show a button 
document.getElementById("buttonId").style.display="block";

or if u want to create a button at runtime. use the following code
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<SCRIPT LANGUAGE="JavaScript">
<!--
function t()
{
	document.getElementById("btnDiv").innerHTML = "<input 
type=button value='runtimeBtn' name='newBtn'>";
}
//-->
</SCRIPT>
</HEAD>


<BODY onload="t()">
<FORM METHOD=POST ACTION="">
<div id="btnDiv"></div>
</FORM>
</BODY>
</HTML>