[jQuery] a on click show form

2007-01-10 Thread unohoo
Hi, I'm a convert from prototype and so apologies if this may come out as a dummy question. What I intend to do is following: I have a link ( element). On click, it displays a form which has 2 radio elements. By default, this form is not visible. only when the element is clicked, the form

Re: [jQuery] a on click show form

2007-01-10 Thread unohoo
So this means the function: $(function() { var jqForm = $('#your-form-id'); jqForm.hide(); $('a').click(function() { jqForm.show(); }); }); will be called when the document / page is ready. And then I also need to have a different function in there for the radio

Re: [jQuery] a on click show form

2007-01-10 Thread Blair McKenzie
Yes, $(fn) is jQuery for run fn when the page is ready. Putting event binding in here ensures that you don't try binding events to elements that don't exist yet. You can bind element events with either $(selectstring).eventname(fn) or $(selectstring).bind(eventname,fn). One thing to think about