dolton
08-31-2008, 12:53 PM
Im trying to use button on the main page. When that button is cliked, it calls a function to display the other buttons. Im displaying the buttons using document.write function. But the other buttons go onto the different.
How to get them on the same page??
The code i use to do this is:
<html>
<head>
<script type="text/javascript" src="loadxmldoc.js">
</script>
</head>
<script type="text/javascript">
</script>
<form id="form1">
<button id="button1"onclick='call()'>Get CD info</button>
</form>
<script type="text/javascript">
function call()
{
document.write("<input type='button' onclick='go1()' value='Title list'>");
document.write("<input type='button' onclick='go2()' value='Artist List'>");
document.write("<input type='button' onclick='go3()' value='Country List'>");
document.write("<input type='button' onclick='go4()' value='Company List'>");
document.write("<input type='button' onclick='go5()' value='Price List'>");
document.write("<input type='button' onclick='go6()' value='Year List'>");
}
</script>
</body>
</html>
How to get them on the same page??
The code i use to do this is:
<html>
<head>
<script type="text/javascript" src="loadxmldoc.js">
</script>
</head>
<script type="text/javascript">
</script>
<form id="form1">
<button id="button1"onclick='call()'>Get CD info</button>
</form>
<script type="text/javascript">
function call()
{
document.write("<input type='button' onclick='go1()' value='Title list'>");
document.write("<input type='button' onclick='go2()' value='Artist List'>");
document.write("<input type='button' onclick='go3()' value='Country List'>");
document.write("<input type='button' onclick='go4()' value='Company List'>");
document.write("<input type='button' onclick='go5()' value='Price List'>");
document.write("<input type='button' onclick='go6()' value='Year List'>");
}
</script>
</body>
</html>