I am having trouble with a school assignment. I don't know much javascript and I am having trouble getting a radio selection to appear inside an areaBox. Here is my code that is not working correctly.
Code:
<html>
<head>
<script type="text/javascript">
function write(selection)
{
var string= "You have selected" +selection;
return string
}
function textWrite()
{
sizeSelection = document.getElementByName('size').value;
var result=write(sizeSelection);
document.getElementById('outputID').value = result;
return result;
}
</script>
</head>
<body>
<form>
<p>What Size Pizza?</p>
<script>
var sizeSelection;
</script>
<input type=radio name="size" onClick="sizeSelection='Personal'" />Personal.
<br />
<input type=radio name="size" onClick="sizeSelection='Small'" />Small.
<br />
<input type=radio name="size" onClick="sizeSelection='Medium'" />Medium.
<br />
<input type=radio name="size" onClick="sizeSelection='Large'" />Large.
<br />
<input type=radio name="size" onClick="sizeSelection='Extra-Large'" />Extra-Large.
<br />
<input type=radio name="size" onClick="sizeSelection='OMG'" />OMG.
<p><input type="button" value="Submit" onclick="textWrite();" /></p>
<p>
<b>Output</b>: <textarea TYPE="text" NAME="output" ID="outputID" SIZE="50"/></textarea>
</p>
</form>
</select>
</form>
</body>
</html>