View Single Post
Old 11-09-2012, 11:25 PM   PM User | #1
stressedStudent
New to the CF scene

 
Join Date: Oct 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
stressedStudent is an unknown quantity at this point
Question Function is undefined

This is really important to fix as soon as possible. I have an absolute headache trying to figure out the mistake and I believe it has to be simple and easily overlooked. My debugger says that the ConvertToCm() and the onclick() function is undefined but I need help in figuring out how to fix that. please someone reply soon.
Code:
<html>
 <head>
   <title>Metric Conversion</title>
   <script type="text/javascript" src="convert.js"></script>
   <script type="text/javascript">
    	function  ConvertToCm()
			{
				var inches, cm ;
				
				inches = parseFloat(document.getElementById('inchBox').value);
				cm = InchesToCentimeters(inches);
				document.getElementById(outputDiv).innerHTML = 
					'That is ' + cm + ' centimeters.';
			}

   </script>
 </head>
 
 <body>
	<p>Length in Inches:
			<input type="text" id="inchBox" size=6 value=1>
			<input type="button" value="Convert to Centimeters" 
				onclick="ConvertToCm();">

   </p>
   <hr>
   <div id="outputDiv"></div>
 </body>
</html>
stressedStudent is offline   Reply With Quote