jQuery and Repeater

Posted on 2011-03-04
Medium Priority
Last Modified: 2012-05-11
If the user inputs a numeric value into the quantity text box, then I would like to set the price and total textboxes to "0.00"
for that row only.

Please see the screen shot, all the textboxes in all rows changed.
How can I limit it by row?

    $(document).ready(function () {
        $("[id$='_txtQuantity']").blur(function () {
            var quantity = $("[id$='_txtQuantity']").val();
            if (isNumeric(quantity)) {

    function isNumeric(n) {
        return !isNaN(parseFloat(n)) && isFinite(n);
screen shot
Question by:JRockFL
LVL 13

Expert Comment

by:Rahul Agarwal
ID: 35041572
Please read the documentation:

LVL 10

Accepted Solution

P1ST0LPETE earned 2000 total points
ID: 35041655
Each row in the repeater should have a unique numeric identifier of some sort.  For example you should have something like:


Then you just need to find the unique identifier (i.e. row index) using javascript.  Then once you have the identifier, you should be able to locate the price and total textboxes fairly easily.  Something like this:

$('[id*="_txtQuantity"]').blur(function ()
       var rowIndex = this.id.substring(12, 1);  //should strip out the "_txtQuantity" just leaving the number
       var quantity = $(this).val();
       var price = $('[id*="_txtPrice' + rowIndex + '"]').val();
       $('[id*=_txtTotal' + rowIndex + '"]').val(quantity * price);

Author Closing Comment

ID: 35043328
Perfect, thank you

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

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.

Join & Write a Comment

I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
There is a wide range of advantages associated with the use of ASP.NET. This is why this programming framework is used to create excellent enterprise-class websites, technologies, and web applications.
The video provides a quick and easy steps to migrate MBOX file to well known Outlook PST and Office 365. Besides this, it also supports and migrates more than 20 email clients of MBOX which include AppleMail, Opera, Thunderbird and SeaMonkey effortl…
If you are looking for an automated solution for backup single or multiple Office 365 user mailboxes to Outlook data file, then you can use Kernel Office 365 Backup & Restore tool. Go through the video to check out the steps to backup single or mult…

622 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question