On Wed, Feb 25, 2009 at 9:55 PM, korsakov <animod...@gmail.com> wrote: > > Thanks for reminding me of the difference! So, isn't there any way to > manipulate PHP variables without actually submitting the whole form? >
I think you're missing a fundamental point here. By the time javascript will be doing anything with your form, your PHP variables will have been written--by PHP--into HTML (or whatever). PHP variables don't exist client side. I'm assuming that "some code" is a function which returns 'checked="checked"' or null, depending on some value comparison. I have a function like that, also, named getChecked(). So, the first thing you want to do is view source to see if PHP is writing what you expect it to. Forget jquery for the moment and make sure the PHP is correct. If you view source and see that a radio button does indeed have checked="checked" but the radio button is not checked, hold down the shift key and reload the page. I've found that both FF & IE screw this up sometimes. Also, you can change your else if to just else, as there's no need to test for the opposite of what's already been tested.