I have two set of radio buttons in html form button and button1. I am using below code to
1.keep the default value checked (
So, the problem is you're setting the checked value twice upon form submission, resulting in selecting either the default value (from initial form state) or the value that has been submitted.
For this to work correctly, you'd need always use PHP to append the checked value to your radio elements, like this:
Here's a working preview: http://codepad.viper-7.com/rbInpX
Also, please note that you're using inline JavaScript notation which is normally discouraged to keep dynamic JS content separate and more manageable ;-)