There seems to be an issue with my function being undefined, even though it is clearly defined below the content of the program.
<button type="button" class="btn btn-primary" data-dismiss="modal" id="CmdBranchEditOk" onclick="CmdBranchEditOk_OnClick()">
@*Add*@
function CmdBranchAdd_OnClick() {
alert('Hi');
@*$('#BranchEdit').modal({
show: true,
backdrop: false
});
document.getElementById('BranchEdit-BranchCode').value = "";
document.getElementById('BranchEdit-Branch').value = "";
document.getElementById('BranchEdit-CompanyID').value = "";*@
}
The main body of the function has been commented out for testing purposes to see if it connects properly. However, when run and pressed, a JavaScript runtime error occurs stating that the function in the button is undefined.
Edit #1: Oops, copied the wrong line of code xD Sorry about that!
<button style="float:left" id="CmdAddBranch" type="submit" class="btn btn-default" onclick="CmdBranchAdd_OnClick()">Add A Branch</button>
Here are the loaded scripts - originally intended for calling a modal but currently set up to just display an alert, which isn't working as expected.
<script src="~/js/jquery.js"></script>
<script src="~/lib/bootstrap/js/bootstrap.js"></script>
<script src="~/wijmo/controls/wijmo.min.js" type="text/javascript"></script>
<script src="~/wijmo/controls/wijmo.input.min.js"></script>
<script src="~/wijmo/controls/wijmo.grid.min.js" type="text/javascript"> </script>
<script src="~/wijmo/controls/wijmo.chart.min.js"></script>
<script src='http://code.jquery.com/jquery-latest.min.js' type='text/javascript'></script>
<link href="~/wijmo/styles/wijmo.min.css" rel="stylesheet" />
Edit #2: Including the entire code block to identify any potential issues. @{ ViewBag.Title = "Branch"; }
...