I have a boolean field in my content type which takes values either 1 or 0. I want to provide a button instead of just displaying the value of field so that the user can click on it and toggle the value.
Is it possible to doing something like this ?
Maybe you should check out the Flag module. Out of the box this module will give you the boolean field, the ajax button on the node view, and rules integration.
The flag module integrates nicely with views. Here is some helpful documentation. http://drupal.org/documentation/modules/flag
You will no longer need the boolean field on your node though so, depending on existing content may require a migration.
It does have a very large user base too and it may save you some development.
If you want to submit a new value for the field on the actual toggle then you'll need to write a custom module with an ajax handler that saves that value for you.
The best answer to this is to Use the Button-Field module and use rules to create actions when the button is clicked. The module already has integration with rules.
Fasttoggle may be what you want.