Adding an 'Add more' button to a settings form in the backend For my module I need a settings form where administrators should be able to enter an arbitrary number of variables.

I have tried setting up an AJAX 'Add more' button, analogous to the example found in the AJAX example module. When I click the button, it doesnt add an extra field and I don't get any errors.

Can anyone help me out?

Example code, and my code: https://gist.github.com/Tagini/8282034
It turns out I had two problems:


I have jquery_update installed, which included a version too recent for the backend. I configured a previous version and I got a whole step further.
I did not have my $form and $form_state as input parameters in my main form function and as such the field count was not updated.