Provided that all the text inputs located after it are within the same <ul>, this should do it:

$('input:text').change(function() {
  $(this).parent().nextAll().find('input:text').doSomething();
});

If you need to check in multiple <ul>s or <fieldset>s, we'll need to tweak the DOM traversal to match the others as well.

--Karl

____________
Karl Swedberg
www.englishrules.com
www.learningjquery.com




On Oct 15, 2009, at 12:07 PM, Julien wrote:


Hi again,

My question was probably too long as I got no answer...

When a change occurs is one of the following text fields, does someone
know how to scan through all the text inputs located after it?

<fieldset name="myfields">
<ul>

 <li><input type="text" name="txt_one" />
     <input type="checkbox" name="chk_one" /></li>

 <li><input type="text" name="txt_two" />
     <input type="checkbox" name="chk_two" /></li>

 <li><input type="text" name="txt_three" />
     <input type="checkbox" name="chk_three" /></li>

</ul>

...assuming that there are more fields and I need some jQuery
automation.

Thanks for your help.

Reply via email to