Hi guys ,

I'm in a middle of webapp implementation one of my pages is providing for users to fill up quote, in this page I wrote some  javascript function in order to calculate the full quote and the sub total.

The issue is that the javascript code is not really functioning.

Here is my part of my code and I attached also some page view of my application.

                        <th valign="top">Dim's: </th>
                            @Html.TextBoxFor(m => m.Dims, new { @class = "inp-form-add ", @maxlength = 200 })
                        <th valign="top">Area: </th>
                            @Html.TextBoxFor(m => m.Area, new { @class = "inp-form-add", @maxlength = 200 })
                        <th valign="top">Discount Unit: </th>
                            @Html.TextBoxFor(m => m.DiscUnit, new { @class = "inp-form-add", @maxlength = 200 })


                        <th valign="top">Disc%: </th>
                            @Html.TextBoxFor(m => m.DiscP, new { @class = "inp-form-add",@onkeyup = "Calsum", @maxlength = 200 })

                        <th valign="top">Price-unit:</th>

                            @Html.TextBoxFor(m => m.Price, new { @class = "inp-form-add", @onkeypress = "return isNumberKey(event)", @onkeyup = "checkDec(this)", @maxlength = 12 })
                        <th valign="top">Total-Price: </th>
                            @Html.TextBoxFor(m => m.Total_Price, new { @class = "inp-form-add",@onchange = "Calsum", @maxlength = 200 })

Open in new window

<script type="text/javascript">
 function Calsum() {
            var untd = $('#DiscUnit').val();
            var pric = $('#Price').val();
            $('#Total_Price').val(untd * pric);


Open in new window

Thanks ,
Moti Mashiah.NET DeveloperAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

käµfm³d 👽Commented:
Change the attribute to:

@onkeyup = "Calsum();"

Open in new window

You need to actually execute the function, not point to it.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Moti Mashiah.NET DeveloperAuthor Commented:
Thank you very much excellent solution.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.