Click here to Skip to main content
15,946,342 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear Friends,

I have a grid in which there are two text boxes i.e., From QTY and To QTY in a row for an item selected in the row itself. When I add another empty row in the grid and if i select the same item then i have to give a check on the focus lost event of the From QTY or To QTY box of that row for checking the value from the above row From QTY and To QTY that the current row From quantity or To quantity doesn't lie between the above row From quantity or To quantity.

I am unable to do that with JavaScript as i am new to it.

Please help me find some code or solution to it.


Varun Sareen

1 solution

I would suggest you spend some time reading the documentation at[^]

Something like this. Of course I have no idea how you are actually structuring the elements.

   // Get the current row
   var parent = $(this).parent();
   // Get the previous row
   var previous = parent.previous();
   // Get the value
   var qty = previous.children("#fromQty")val();
Share this answer
Varun Sareen 28-Feb-11 1:15am    
Thanks Mark :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900