Scamjunk said on 03/05/2006 3:53 PM AEST:
I am a total JavaScript newbie and I got a JavaScript for maintenance
that collapses/expands rows whenever the (-)/(+) GIFs are clicked.
Could it be changed to do the same with radio buttons? on checking of a
radio button the respective row should expand, else remain collapsed.
and if another radio button is chosen then the row originally expanded
should collapse. Is this doable? If so, what should I be changing in
this code?
^^^^
Which code is that?
Yes, it's it should be straight forward. Associate each radio button
with a row, add an onclick handler that loops through the collection of
buttons to collapse the ones that aren't checked and expand the one that is.
How do you intend to expand and collapse rows? Using visibility:hidden
or display:none? Will you hide the entire row or just the content
(which should cause the row to 'collapse')?
Test thoroughly, there may be timing issues where the onclick fires
before or after the checked property is set or changed in some browsers
(I don't know, I haven't tested it).
If you have trouble with getting it to work (and you have something to
post), ask for help. :-)
--
Rob
Group FAQ: <URL:http://www.jibbering.com/FAQ>