I'm stuck on this project and not sure what's going wrong. I need to return the temp conversion of a users input on click. Any help would be appreciated.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">

<head>
   <title>Temperature Converter</title>
      <script type = "text/javascript">
 	 <!--
              
	     function calculateCelsius()
		{
 		var form = document.getElementById("formTemp");
		var value =  parseInt(form.fahrenheitInput.value);
 		form.celsiusInput.value = celsius(value);
		
		var C = 0;
		C = 9.0 / 5.0 * celsiusInput + 32 +"F";
		
		return C;
		}
		
 	     function calculateFahrenheit()
		{
		var form = document.getElementById("formTemp");
		var value = parseInt(form.celsiusInput.value);
 		form.fahrenheitInput.value = fahrenheit(value);

		var F = 0;
		F = (5.0 / 9.0 * (fahrenheitInput- 32)+"C");

		return F;
		}



     </script>
 </head>

 <body>
   <form ID="formTemp">
      	
	   <p>Fahrenheit</p>
	   <input name = "fahrenheitInput" type = "text" />
	   <input type = "button" value = "Convert to Celsius" onclick = "calculateCelsius()" />
 	
	   <p>Celsius</p>
 	   <input name = "celsiusInput" type = "text" />
	   <input type = "button" value = "Convert to Fahrenheit" onclick = "calculateFahrenheit()" />
 	    
   </form>
 </body>
 </html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">

<head>
  <title>Temperature Converter</title>
    <script type = "text/javascript">
    <!--
    function calculateCelsius() {
      var form = document.getElementById("formTemp");
      var value =  parseInt(form.fahrenheitInput.value);
      form.celsiusInput.value = (9.0 / 5.0 * value + 32) +"F";
    }
		
    function calculateFahrenheit() {
      var form = document.getElementById("formTemp");
      var value = parseInt(form.celsiusInput.value);
      form.fahrenheitInput.value = (5.0 / 9.0 * (value-32))+"C";
    }
    </script>
  </head>

 <body>
   <form ID="formTemp">
     <p>Fahrenheit</p>
     <input name = "fahrenheitInput" type = "text" />
     <input type = "button" value = "Convert to Celsius" onclick = "calculateCelsius()" />
 	
     <p>Celsius</p>
     <input name = "celsiusInput" type = "text" />
     <input type = "button" value = "Convert to Fahrenheit" onclick = "calculateFahrenheit()" />
   </form>
 </body>
 </html>

I hope you look at this code and give you a better idea about how to work with HTML elements. Not have much time to explain right now, sorry...

Definitely, just got out of basic HTML and now starting to work with javascript. It is still a bit confusing at the moment.
Thank you so much

I hope you look at this code and give you a better idea about how to work with HTML elements. Not have much time to explain right now, sorry...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.