View Single Post
Old 11-05-2012, 10:58 PM   PM User | #1
Redwards34
New to the CF scene

 
Join Date: Nov 2012
Posts: 7
Thanks: 3
Thanked 0 Times in 0 Posts
Redwards34 is an unknown quantity at this point
Sending FormInput to Areabox

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>
Redwards34 is offline   Reply With Quote