[jQuery] Re: Traversing table

2008-09-27 Thread Dave Methvin
I think you want an event handler for the input elements. Maybe something like this? Instead of finding the column in the row above, I just looked for the Nth price in the row above. That turned out to be the most complicated part. The DOM defines a .rowIndex property for TR elements but there is

[jQuery] Re: Traversing table

2008-09-27 Thread Oreste
On Sep 8, 10:38�pm, Jayzon <[EMAIL PROTECTED]> wrote: > What I'd like to do: If an input filed is focussed, a price should be > calculated. To keep the script as efficient as possible, I want to > travel up from the input field to thecellabove it (i.e. one row up, > second or thirdcellin that row)

[jQuery] Re: Traversing table

2008-09-24 Thread Jayzon
Hi again! I tried to get the script done by myself since no one unfortunately answered my last entry - this is the bit of code i managed to get done: $(document).ready(function() { $("input").change(function() { var char_count = $(this).val;

[jQuery] Re: Traversing table

2008-09-09 Thread Jayzon
Well, I just tried to get a starting point for the js file: $(document).ready(function() { var char_count = $("input").val; var position = $("input:focus").parent().eq(); var price = $("input:focus").parent().parent().children("pricing"). ("td").eq

[jQuery] Re: Traversing table

2008-09-09 Thread Jayzon
Hi Karl, I'm not sure if you missed them, but I placed the input fields inside the table, they are in tr.calc (the second row in the html in my first post). It's just an tag. That input field would then be a nice starting point, because it's placed directly under the span including the price & i

[jQuery] Re: Traversing table

2008-09-09 Thread Karl Swedberg
Hi Markus, Can you show us just a bit more of the HTML? It would help a great deal if we could see where the input field is in relation to the spans that you want to modify. --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Sep 8, 2008, at 4:38 PM, Jayzon

[jQuery] Re: Traversing table

2008-09-09 Thread Jayzon
Hi Rene! Thanks for your answer - that would be a nice solution for one single table. But I'd like to use the script for various tables on different pages. That's why it is getting more complicated. If I could get this done, other editors wouldn't have to care about IDs etc., but could just wrap

[jQuery] Re: Traversing table

2008-09-08 Thread Rene Veerman
put valid id's on all relevant tags, then reference by id? On Mon, Sep 8, 2008 at 10:38 PM, Jayzon <[EMAIL PROTECTED]> wrote: > > Hi! > > I've got a table with multiple rows which I'd like to traverse in a > special way - here's the html (for better reading, I just included two > rows, these rows