Forum Moderators: open
While I can understand your point of view, and why you want the form to clear if someone clicks the back button, it also seems like there are perfectly reasonable reasons why a user should be able to expect the data not to clear. Perhaps, instead, you need to think about how you can better redesign your site's functionality not to be affected by browser behavior you really have no control over. Trying to control browser behavior is much more difficult than to code in a way not vulnerable to such behavior.
... if I'm making any sense.
I'm using PHP for my mailer! My client wanted visitors to have the option of purchasing a gift card on line. The visitor would enter Credit Card info (secure) and after completion a thank you page would appear to be eprinted for receipt. I am using the PHP print() to bring the variables over to the thank you page and the entered info (minus CC) would be on the thank you page.
I have basic knowledge of PHP; however. I did want the info to clear once the button is submitted. I guess I could use JavaScript submit once and disable the submit button after submission.
Why should a radio button be always checked. I use PHP to check for an empty field and if so an error kicks back.
Thanks
Technically you don't HAVE to have a default value for a radio, but you should because that's the way they're designed to work. Problems will arise, for example, if you load it blank and someone checks a response, a refresh of the page won't load it completely blank again because the browser is doing what it's supposed to according to the specification (although I've noticed lately that FireFox sometimes doesn't act the way it's supposed to with radio buttons.)
Logically a radio button is meant to force a selection for a required input. It's just the way they're meant to work. It's this "expected behavior" that allows you to NOT have to check for a value on a radio selection, it will just be there. If you don't want a required input, use a checkbox.