Seems that you are building the elements of the form some parts using ajax and some parts using what you show on [JsFiddle][1]. Your issue could be caused by elements on the DOM that are not loaded yet through Ajax. If that is the case, you could use he [Ajax framework][2] and [Ajax framework commands][3] API documentation to run commands after success of an Ajax callback. Here is a [brief example][4]. In case that the problem is caused by something declared inside of Drupal.behaviors.mymoduleLinkit, try to debug your Js code with Chrome/Firefox DevTools. Add some breakpoints to find out what is causing the issue. [1]: http://jsfiddle.net/m37pw2nL/1/ [2]: https://api.drupal.org/api/drupal/includes%21ajax.inc/group/ajax/7 [3]: https://api.drupal.org/api/drupal/includes%21ajax.inc/group/ajax_commands/7 [4]: http://stackoverflow.com/questions/3357116/how-to-reload-the-custom-javascript-file-after-drupal-makes-ajax-call/19404566#19404566