I've created a csv import feature so that users can upload a csv file, choose from a drop down list what content each collumn contains and then it will be sent to the database. I'm using jquery to change the name attribute in each input field. It works great for the first choice but if the user makes a wrong choice or changes their mind it does not change the name attribute a second time. Here is the code:


Code JavaScript:
$("select").change(function () {
      var fieldName = $(this).attr('name');
      var optionValue = $(this).val();
      $('input[name=' + fieldName + ']').attr('name', optionValue);
	})

Any ideas?