It is always better to restore the form state from the server side. That way, I believe you would fail gracefully incase the browser has disabled javascript. Moreover, it prevents distortion while rendering the page.
On Sun, Jan 25, 2009 at 3:10 AM, LoicDuros <loic.du...@gmail.com> wrote: > > Thanks Rick, I'll try to use .selected! This should help a lot. > > Regards, > > Loic > > On Jan 24, 3:41 pm, "Rick Faircloth" <r...@whitestonemedia.com> wrote: > > Hi, Loic... > > > > Check out this page about .selected. The example given > > when you follow the link is about a select input, but it seems > > that it could apply to radio inputs, as well. > > > > Rick > > > > http://docs.jquery.com/Selectors/selected > > > > > -----Original Message----- > > > From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] > On Behalf Of LoicDuros > > > Sent: Saturday, January 24, 2009 3:02 PM > > > To: jQuery (English) > > > Subject: [jQuery] .change alternative > > > > > Hi, > > > > > I'm using a .change function to find out whether a radio button or not > > > is selected by the user. I then show() or hide() other fields > > > according to which radio button has been selected. Now, the problem > > > arises when someone clicks on the reload button of the browser, or if > > > some php validation returns to the form, some fields remain hidden > > > because the .change function has not been triggered. Is there a way to > > > detect which radio button is selected - before any user input? I'm > > > thinking of something like: if radio button with id is selected, then > > > show / hide these other fields. > > > > > Is there something like .selected? I could use and check from the > > > value? > > > > > Thanks for your help! > -- Thanks Ram