Here is a very simple implementation of what you need - You will have to improvise this to your needs. The main objective is to give you an idea! I have added comments inline!
http://jsfiddle.net/FNt5N/2/[
^]
In this method I have used jQuery and jQuery UI. There are no validations or any silver linings, since that would be a good learning exercise for you!
Missed some inputs for the 2nd part of your question! In the click event you could use the id to issue an ajax request by providing the id and then load the result! Check out:
$.ajax[
^]
similar question[
^]