Having significant problems making a simple link between a form's buttons and javaScript functions.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="generator" content="HTML Tidy for Linux (vers 6 November 2007), see www.w3.org" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Examples of Strings</title>
<script type="text/javascript">
//<![CDATA[
// declarations
//]]>
</script>
</head>
<body>
<h1>Basic Calculator</h1>
<form action="form_action.asp" method="get">
First Variable: <input type="text" name="tb1" /><br />
Second Variable: <input type="text" name="tb2" /><br />
Result: <input type="text" name="result" /><br />
<input type="button" name="b1" value="Submit" onclick="myAdd()" /><br />
</form>
<script type="text/javascript">
//<![CDATA[
<asp:Button id="b1" runat="server" OnClick="documment.myAdd()"></asp:Button>
function myAdd(tb1, tb2){
var result = tb1 + tb2;
alert(result);
return result;
}
//]]>
</script>
</body>
</html>
Button (b1) should return the values at tb1 and tb2. Note: ultimately it should represent the value at tb3, but for the purposes of debugging tb3 is doing nothing at the moment.