The select_name.replace RegEx wipes out everything between [] brackets, rather than just removing the bracket characters alone. This means that when a form has an array of names:

<select name='submitted[array_key]'>

then the select_name_nice variable ends up as "submitted" -- which in turn causes all of the "submitted" array fields to process the click event simultaneously, which causes every other one to never open.

This RegEx fixes it:

var select_name_nice = select_name.replace(/[\[\"\]]/g,'');//strip out []