b_j_mall
08-28-2002, 12:52 AM
A btton executes a fucntion that further generates a button, this button is used to execute a function, but gives an error.
The code is given below,i really need some, thanks for your time.
--------------------------------------------
<html>
<head>
<SCRIPT LANGUAGE="javascript">
function init()
{
alert('how u doin');
document.write("<form name=major>") //This generates another button
document.write("<input type=button name=start1 value=anotherOne onClick='init1()'>")//this button should //execute init1() but gives an error
document.write("</form>")
}
function init1()
{
alert('i am ok');
}
</SCRIPT>
</head>
<body onLoad='init()'>
<p>hello!</p>
<FORM NAME="joe">
<input type=button name=start value=startIt onClick='init1()'> <!-- This button click executes init() funtion-->
</FORM>
</body>
</html>
The code is given below,i really need some, thanks for your time.
--------------------------------------------
<html>
<head>
<SCRIPT LANGUAGE="javascript">
function init()
{
alert('how u doin');
document.write("<form name=major>") //This generates another button
document.write("<input type=button name=start1 value=anotherOne onClick='init1()'>")//this button should //execute init1() but gives an error
document.write("</form>")
}
function init1()
{
alert('i am ok');
}
</SCRIPT>
</head>
<body onLoad='init()'>
<p>hello!</p>
<FORM NAME="joe">
<input type=button name=start value=startIt onClick='init1()'> <!-- This button click executes init() funtion-->
</FORM>
</body>
</html>