When I select the first radio box, the expected event if happening. But what I want to close all other div tags before opening this?And by closing all other div tags, I don't mean closing everything on the form, just the div tags related to this particular field. how is this achieved?
Do not know what is your event object but just with toggle you will not be able to close the other divs because i assume toggle switches the display property so you do not have feedback what it was before the toggle.
Thank You.. Just tried it out with the Event attribute itself. That is a definition in the library. It is fine for a limited div tags, but what abt a page having a lot of tags? I cannot possible use permutations here...
Then you can write a function what i said as suggestion. This function will contain all the div id-s defined and will accept the id of the div you want to display as argument. This will make it to loop through all the div-s setting their display="none" and finally sets the display="block" for the element you passed as argument.
You can use common div names to load the div id-s for example if your divs are eventcontentXXX you can do
<body onLoad="load_divs(8)"> <!-- This is if you plan to have 8 divs from eventcontent1 to eventcontent8 -->
....
....
<input type="radio" name="sample" value="1" onClick="bla(5)">Sample1<br> <!-- This will hide all divs and display div #5 -->