Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 4 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4: in C# and VB by Imar Spaanjaars; ISBN: 9780470502211
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4 : in C# and VB section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 29th, 2013, 11:00 AM
Authorized User
 
Join Date: Oct 2012
Posts: 19
Thanks: 6
Thanked 0 Times in 0 Posts
Default Problems with GridView

In my application I need to have the value placed into one field to be the result of a calculation based on values in two other fields. I tried to do this with the following jQuery:
Code:
   <script type="text/javascript">
        $(function () {
            $("input[type='text']").change(function () {
                var unitNetPrice = (this.value);
                var quantity = $(this).prev().prev();
                var netPrice = quantity * unitNetPrice;
                $(this).next().next().attr('value', netPrice);
            });
        })
    </script>
I was hoping that this would fire while the user is in Edit mode on the row and after the user has entered the "unitNetPrice". It also assumes that the user has already entered "quantity". But nothing happens. Is there a small glitch in this approach or is this not the way to approach this?

Another problem I just noticed is how to validate the user's input. When I enter the DataFormatString, that is what is displayed in the non-edited rows instead of the actual data.
 
Old March 29th, 2013, 11:11 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

Since this is not related to my book directly, try posting this in the General ASP.NET category from this list: http://p2p.wrox.com/asp-net-4-539/ That way, you'll attract more viewers. If you post there, consider expanding your problem description and sample code.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!





Similar Threads
Thread Thread Starter Forum Replies Last Post
GridView Problems Bajrang ASP.NET 2.0 Basics 0 May 16th, 2007 05:53 AM
Gridview checkbox problems pauliehaha ASP.NET 2.0 Professional 1 May 3rd, 2007 04:14 AM
Multiple problems with Login system, GridView hindereduseless ASP.NET 2.0 Professional 0 May 3rd, 2006 01:13 AM
multiple problems with logins and gridview hindereduseless ASP.NET 2.0 Basics 0 May 3rd, 2006 01:01 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.