Hi I'm not really sure why this isnt working. Could someone ammend the code so that it is working?
cheers
<html>
<head>
<meta name="generator" content="HTML Tidy for Linux (vers 25 March 2009), see www.w3.org">
<title>Limerick Generator</title>
<script type="text/javascript">
function display(f)
{//code to get data from List boxes
var DirectionSelect = document.getElementById('Direction')
var Direction = DirectionSelect.options[DirectionSelect.selectedIndex].text;
var VerbSelect = document.getElementById('Verb')
var Verb = VerbSelect.options[VerbSelect.selectedIndex].text;
var DirectionRhymeSelect = document.getElementById('DirectionRhyme')
var DirectionRhyme = DirectionRhymeSelect.options[DirectionRhymeSelect.selectedIndex].text;
for (var i=0; i < document.LimGenerator.bodytype.length; i++)
{
if (document.LimGenerator.bodytype[i].checked)
{
var body_val = document.LimGenerator.bodytype[i].value;
}
}
document.write("There was a " + (body_val) + " " + (f.occupation.value) + " called " + (f.Cname.value) + "<br>" + "Who " + (f.workdone.value) + " more than he wanted to " + (f.Rname1.value) + "<br>" + "One day he " + Verb + " " + Direction + "<br>" + "And said with a " + Expression + "<br>" + "That his " + (f.doing.value) + " was more than a " + (f.Rname2.value) + "<br>");
}
</script>
<style type="text/css">
body {
background-color: moccasin;
color: #000000;
}
:link { color: #0000FF }
:visited { color: #800080 }
:active { color: #FF0000 }
div.c1 {text-align: center}
</style>
</head>
<body>
<div class="c1">
<h2>Limerick Generator</h2>
</div>
<form name="LimGenerator">
<table border="0" width="50%">
<tr>
<td width="25%"><strong>Question</strong></td>
<td width="25%"><strong>Answer</strong></td>
</tr>
<tr>
<td>Name of your character</td>
<td><select name="character" size="1" id="character">
<option>Please Choose</option>
<option>Bill</option>
<option>Will</option>
<option>Jill</option>
<option>Gill</option>
</select><br></td>
</tr>
<tr>
<td>Please choose a body type</td>
<td><select name="body" size="1" id="body">
<option>Please Choose</option>
<option>Thin</option>
<option>Fat</option>
<option>Tall</option>
<option>Short</option>
</select><br></td>
</tr>
<tr>
<td>Two words that rhyme with your character's name</td>
<td><select name="characterrhyme" size="1" id="characterrhyme">
<option>Please Choose</option>
<option>Kill</option>
<option>Spill</option>
<option>Thrill</option>
</select><br></td>
</tr>
<tr>
<td>Name your characters occupation</td>
<td><select name="Occupation" size="1" id="Occupation">
<option>Please Choose</option>
<option>Butcher</option>
<option>Baker</option>
<option>Cleaner</option>
</select><br></td>
</tr>
<tr>
<td>What is the past tense of a task your character might do at work</td>
<td><select name="task" size="1" id="task">
<option>Please Choose</option>
<option>Chopped</option>
<option>Cooked</option>
<option>Cleaned</option>
</select><br></td>
</tr>
<tr>
<td>Pick a past tense verb</td>
<td><select name="Verb" size="1" id="Verb">
<option>Please Choose</option>
<option>Sat</option>
<option>Jumped</option>
<option>Hopped</option>
</select><br></td>
</tr>
<tr>
<td>Pick a direction</td>
<td><select name="Direction" size="1" id="Direction">
<option>Please Choose</option>
<option>Right</option>
<option>Back</option>
</select><br></td>
</tr>
<tr>
<td>Pick a word that rhymes with your direction</td>
<td><select name="DirectionRhyme" size="1" id="DirectionRhyme">
<option>Delight</option>
<option>Contrite</option>
<option>Quack</option>
<option>Clack</option>
</select><br></td>
</tr>
<tr>
<td>Please pick a gender.</td>
<td><input type="radio" name="gender" value="M">male<br>
<input type="radio" name="gender" value="F">female<br></td>
</tr>
<tr>
<td><input type="button" value="submit" onclick="display(this.form)"></td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td><input type="reset" value="Reset" onmouseover="window.status='Clears the form'" onmouseout="window.status='Limerick Generator'"></td>
<td></td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td>
<h4>Example Limerick Output</h4>
</td>
</tr>
<tr>
<td>
<h4 id="NewLimerick"><em>There was a fat butcher called Bill<br>
Who cooked more than he wanted to kill<br>
One day he sat down<br>
And said with a frown<br>
That his eating was more than a thrill.</em></h4>
</td>
</tr>
</table>
</form>
</body>
</html>