Jquery question about altering dynamically created form fields

The link below is a stripped down section of a form.

http://development.omprakash.org/test.html

The problem I’m having is with altering the names of the fields. I’m trying to add an identifier on the end. “_X_1”, “_X_2” after the new sections are added.

NOTES:

Incidentally, “X” is a delimiter so the key can be converted into an array on the back end to extract data from it.

I can’t alter the “repeater” variable because it would be extremely complicated on the back end.

Thanks for your help,

E

I figured it out.

The key was to use this selector “$(‘#cross_table_repeater’).find(‘:input’)”

I don’t understand why “$(‘input’)” didn’t register, but this did the trick.

function adjust_names(){
            
    	$('#cross_table_repeater').find(':input').each(function(){
    	
    	  identifier=$('div').index($(this).parent());
    	  
          old_name=$(this).attr('name');
          new_name=old_name+'_X_IDENTIFIER'+identifier;
          $(this).attr('name',new_name);
          
        });              
                
    }

E