@{
    ViewBag.Title = "TextBoxes";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<div id = "ControlRegion">
<h2>Text Boxes:</h2>
<br/>
<div class="frame">
        <div class="control">
            <table class="editors">
                <tbody>
                    <tr>
                        <td>
                            <label>
                                Numeric TextBox 1</label>
                        </td>
                        <td>
                            @Html.EJ().NumericTextbox("numeric1").Value("1000").CssClass("stock-open-val")
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <label>
                                Numeric TextBox 2
                            </label>
                        </td>
                        <td>
                            @Html.EJ().NumericTextbox("numeric2").Value("1000").CssClass("stock-open-val")
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <label>
                                Numeric TextBox 3
                            </label>
                        </td>
                        <td>
                            @Html.EJ().NumericTextbox("numeric3").Value("1000").CssClass("stock-open-val")
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <label>
                                Numeric TextBox 4
                            </label>
                        </td>
                        <td>
                            @Html.EJ().NumericTextbox("numeric4").Value("1000").CssClass("stock-open-val")
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <label>
                                Numeric TextBox 5
                            </label>
                        </td>
                        <td>
                            @Html.EJ().NumericTextbox("numeric5").Value("1000").CssClass("stock-open-val")
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <button id="total" onclick="myFunction()">Click to Calculate Total</button>
                        </td>
                    </tr>
                    <tr>
         
                        <td>
                            <label>
                                Total
                            </label>
                        </td>
                        <td>
                            @Html.EJ().NumericTextbox("ntbTotal").CssClass("stock-open-total").MinValue(0).WatermarkText("").ReadOnly(true).ShowSpinButton(false)
                        </td>
                    </tr>
                  
                </tbody>
            </table>
        </div>
    </div>
</div>
<script>
    function myFunction() {
        var openValTBs = $(".stock-open-val .e-numerictextbox");

        var openTotal = 0;

        for (var i = 0; i < openValTBs.length; i++)
        {
            var value = openValTBs[i]["value"];
            if ($.isNumeric(value)) openTotal += parseFloat(value);
        }
        $("#ntbTotal").ejNumericTextbox("instance").option({ value: openTotal });
    }
</script>