I have in a DIV w/ ID="#invisible" containing lots of backed up form values in inputs sharing class named"backup".
Also related table IDs for elements in the form, (say customer_id for a dropdown showing customer name), using class='other_table_ids".
Their names and IDs are the field name. (e.g.: customer_id).
For these, which are changed on a dropdown change, I keep their original as-loaded form values in inputs with class='otid_orig".
These have names and IDs like "otid_orig_"+customer_id.
After an update or insert I want to change the value of the as-loaded IDs to what they currently are (as stored in inputs w/ class='other_table_ids'.
The code below just does not change the values. I'm including two methods I've tried.
Can one not change the value of an element in its .each() function?
var otid_name = $(this).attr('name') ;
var name = otid_name.substr(10) ;
var curr_value = $('#'+name).val() ; alert('otid name='+otid_name+' other_table_ids name='+name+'. that guys value='+curr_value ) ;
// also tried: $('#invisible #'+name).val(curr_value) ;