diff --git a/webapp/views/data_tables/templates/clone_attributes_4.html b/webapp/views/data_tables/templates/clone_attributes_4.html index 4f4b7f9a..6f9f4203 100644 --- a/webapp/views/data_tables/templates/clone_attributes_4.html +++ b/webapp/views/data_tables/templates/clone_attributes_4.html @@ -40,9 +40,14 @@ function select_default(_select_id) { // We need to replace spaces with underscores in the SELECT id for jQuery to work properly let select_id = _select_id.replace(/ /g, '_'); - let selector = '#' + select_id + ' option'; // Get rid of SELECT__ and __SELECT substrings let default_val = select_id.substring(8, select_id.length - 8); + // jQuery interprets '.' as a class selector, so we need to escape '.' with '\\' + // It's a double backslash because the first backslash is an escape character in a string. I.e., we're + // saying we want the backslash to go into the string, not be interpreted as an escape character. + // Now the selector will correctly find the option with the value that has a period in it. + select_id = select_id.replace(/\./g, '\\.'); + let selector = '#' + select_id + ' option'; $(selector).filter(function() { let this_text = $(this).text().replace(/ /g, '_'); return this_text === default_val;