Hi Ram,

I'm not sure what you mean. In any case, to give a little bit of
background to my question. I'm using jQuery with a custom creation
form in drupal and conditional fields. Fields that are hidden in the
first place all appear - independently from what radio button has been
selected - if you try to submit the form and did not populate a
required form. I have two different fields to upload files. someone is
supposed to either see one or the other. If the php validation gets
back to the form, then both are displayed. I want to detect which
field of the category radio buttons has been selected previously so
that I can hide or the other.

Thanks,



On Jan 24, 4:53 pm, Ramanathan RV <ramanatha...@gmail.com> wrote:
> 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

Reply via email to