Community

need help with basic jquery UI dialog - form API question

Hi,
I'm using D7.
I have a module that creates a form, the form has an 'Add' button.
I want that a click on the button will open a modal dialog box (I was thinking jQuesry UI dialog) with few textfields for the user the enter data and click the submit on the dialog. This will close the dialog and add the data from the dialog to the form (via ajax call if possible) - so the form will have new entries.

I'm kind of lost in how to begin:
* how to create the dialog form? (do I create the dialog in JS or in php/drupal form api?)
* how to pass data to the dialog, and how to get data back from it?

I can't find any simple code sample, the ones I have found are too complex for me to understand.

please point me in the right direction.
Thank you.

nobody click here