Matt_Mikolaj
08-02-2005, 10:40 PM
Can anyone tell me why this code doesn't work or can anyone fix it? I want to have it that when the user types something in the textbox, a certain message comes up in the textarea! The options in the code are "Die" and "WEEEEEE". THX!
<form name="textbox">
<p align="center">
<textarea name="textarea" rows="30" cols="101"></textarea>
</p>
<input name="inputbox" type="text" size="130">
<button onclick="getinputinfo()">Click Here</button>
</form>
<script type="text/javascript">
var message = "Thou art in thy bedroom. Thy bed is not made.<br>Seen exits are north, east, and west.";
var inputbox = document.forms.textbox.inputbox.value;
function getinputinfo()
{
if(inputbox = "Die") message = "You are dead";
if(inputbox = "WEEEEEE") message = "I Don't Understand...";
document.forms.textbox.textarea.value = message;
}
</script>
<form name="textbox">
<p align="center">
<textarea name="textarea" rows="30" cols="101"></textarea>
</p>
<input name="inputbox" type="text" size="130">
<button onclick="getinputinfo()">Click Here</button>
</form>
<script type="text/javascript">
var message = "Thou art in thy bedroom. Thy bed is not made.<br>Seen exits are north, east, and west.";
var inputbox = document.forms.textbox.inputbox.value;
function getinputinfo()
{
if(inputbox = "Die") message = "You are dead";
if(inputbox = "WEEEEEE") message = "I Don't Understand...";
document.forms.textbox.textarea.value = message;
}
</script>