With lot of help from lots of people, and after hours of internet search I was able to successfully link my Form buttons to a single function using AJAX. It is really mind-boggling if you’ve never done anything related to jQuery ‘n all.
The level of difficulty for doing this did rose because I’ve to do this according to the wordpress guidelines.
It feels awesome when the thing you’ve designed runs correctly.
Also I’ve installed Qt on my system today. I was really impressed with Qt when I saw some of the GD members working on it. Then I read about Qt on internet and I really felt compelled to use it. You can download it very easily from here.