Hey guys, new to javascript. I was just wondering could you point me in the right direction as to where i might be going wrong. Please see code below.

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
        <script language="JavaScript">function myadd(a,b){
            document.addForm.result.value=parseInt(a)+parseInt(b);
        }
        </script>
    <noscript>JavaScript is not enabled!</noscript>
    </head>
    <body>
        
        Number 1: <input type="text" name ="num1" /><br>
        Number 2: <input type="text" name ="num2" /><br>
        Result: <input type="text" name ="result" /><br>
        <input type="button" value="Add the numbers" onclick="myadd(document.addForm.num1.value, document.addForm.num2.value)">
            
    </body>
</html>

When I press the button for the answer, it doesn't show it. Any ideas? Thanks in advance

No worries guys I got the answer. I never added in the form.

The big thicko from the island

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.