The problem is rather sinple: I can't figure out how to make the script work:
I'm trying to make the script so that there's a textbox(I will make it multi-lined later) which displays a variable that is changed when a button is clicked. There will be more than 1 button. Why doesn't this code work, and, please can someone post a working version? And I labelled the form things with dynamic because it's a really cool word, that's all =).
Code:
<head><script language="JavaScript">
var dynamic_code_index;
var dynamic_code_index="Click a button to display the code in the textbox";
function SetTextbox (num) {
dynamic_code_index=num;
}
dynamic_code_view.dynamic_code_box.value=dynamic_code_index;
// Makes a usable variable which is applied to the textbox
</script></head>
<body>
<!--creates the form and stuff!-->
<form type="dynamic_code_view" action="" method="GET">The code will be displayed into the box: <BR>
<input type="text" name="dynamic_code_box" value="This website is not working properly"><P>
<input type="button" name="button1" value="example" onclick=SetTextbox('hello')>
</form>
</body>
Comment