In the module that I'm developing, I have two select forms side by side. In between these forms are buttons which are used to move items in the second list.
I tried to base this off the admin page for the HTML AREA module (/admin/system/modules/htmlarea), but I was unsuccessful in hacking the code for my module. I then turned to the internet where I found this little example. I think that this example would have worked. But I'm running into syntax errors. The onclick commands don't like the drupal generated names for the select forms. Drupal kicks out form names like:
name="edit[node_list_options][]"
These names don't play nice with onclick javascript actions that are passing the form information. Example:
document.form.edit[node_list_options][].selectedIndex
To get around this, I tried to manipulate the select forms via Javascript by passing the id. Drupal does generate clean id names. I did this with:
document.getElementById("node_list_options").selectedIndex
This didn't seem to work either. Does anyone know of a good way to incorporate javascript into modules? I need to have two select boxes side by side, along with an add, remove, up, down and submit button. The first select box will pull a list of available nodes, the second will pull a list of assigned nodes.