JS and CSS question

Started by Søren Bjerg, August 08, 2004, 10:49:52 AM

Previous topic - Next topic

Søren Bjerg

After having fought with this for a while, and stared myself blind on the code, I thought I'd try to draw on the knowledge of some of you people... hoping you can help me out :).

My problem is, that if I have the HTML as found below, where the text is hidden per default, how would I go about making it so I can click the first radio button to make the text appear, and click on the second radio button to make the text disappear again?


<form name="editmember">

<input name="isActive" type="radio" value="1" />
<input name="isActive" type="radio" value="2" />

<div id="dateLeft" style="display: none;">
text
</div>

</form>


I've tried various forms of the JS below (the onclick action) to make it work... but with no results :(.


<input name="isActive" onclick="document.dateLeft.style.display='inline'" type="radio" value="1" />


Anyone? :)
RUNE HORDES dot INFO - SMF 1.1.10 w/ Custom Profile Mod... and various permissions hooks and template changes (new topic form).

[Unknown]

document.getElementById('dateLeft').style.display = 'block';

And:

document.getElementById('dateLeft').style.display = 'none';

-[Unknown]

Søren Bjerg

Awesome 8)! Thanks... so close - yet so far - from having gotten it right...
RUNE HORDES dot INFO - SMF 1.1.10 w/ Custom Profile Mod... and various permissions hooks and template changes (new topic form).

Advertisement: