ComoUna
05-31-2005, 06:41 PM
can anyone please tell me why nothing happens when i click the submit button. i've spent hours on it but cant figure out what i did wrong yet. :(
<html>
<body>
<form = myForm>
<table border = 5>
<tr>
<td>Please enter a name<td>
<td><input type = text name = txtName></td>
</tr>
<tr>
<td>Please enter a country<td>
<td><input type = text name = txtCountry></td>
</tr>
<tr>
<td>Please enter a city<td>
<td><input type = text name = txtCity></td>
</tr>
<tr>
<td>Please enter a color<td>
<td><input type = text name = txtColor></td>
</tr>
<tr>
<td colspan = 4><center><input type = button value = "click to submit" onClick = makeStory()></td>
</tr>
</table>
<textarea name = txtStory rows = 10 cols = 35></textarea>
</form>
</body>
</html>
<script>
function = makeStory()
{
var person = document.myForm.txtName.value;
var country = document.myForm.txtCountry.value;
var city = document.myForm.txtCity.value;
var color = document.myForm.txtColor.value;
var story;
story = " one day a man named " + person;
story += " came to " + country;
story += "looking for the " + city;
story += "that was " + color;
story = document.myForm.txtStory.value;
}
</script>
<html>
<body>
<form = myForm>
<table border = 5>
<tr>
<td>Please enter a name<td>
<td><input type = text name = txtName></td>
</tr>
<tr>
<td>Please enter a country<td>
<td><input type = text name = txtCountry></td>
</tr>
<tr>
<td>Please enter a city<td>
<td><input type = text name = txtCity></td>
</tr>
<tr>
<td>Please enter a color<td>
<td><input type = text name = txtColor></td>
</tr>
<tr>
<td colspan = 4><center><input type = button value = "click to submit" onClick = makeStory()></td>
</tr>
</table>
<textarea name = txtStory rows = 10 cols = 35></textarea>
</form>
</body>
</html>
<script>
function = makeStory()
{
var person = document.myForm.txtName.value;
var country = document.myForm.txtCountry.value;
var city = document.myForm.txtCity.value;
var color = document.myForm.txtColor.value;
var story;
story = " one day a man named " + person;
story += " came to " + country;
story += "looking for the " + city;
story += "that was " + color;
story = document.myForm.txtStory.value;
}
</script>