Javascript Show/Hide in widget options
-
Hi,
I’m putting together a widget, and am struggling to show/hide elements when clicking on an radio button using jQuery. Here’s my code:
<p><label for="postcode">Postcode</label> <input type="radio" name="type" onclick="jQuery('#postcodepanel').toggle()" value="postcode" /></p> <p><label for="postcode">Local Authority</label> <input type="radio" name="type" onclick="jQuery('#authoritypanel').toggle()" value="authority" /></p> <div id="postcodepanel" style="display:block;"> Postcode panel stuff here </div> <div id="authoritypanel" style="display:block;"> Authority panel stuff here </div>
I’ve tried using jQuery and vanilla Javascript and nothing seems to work. I’ve enabled Firebug and I don’t get any errors. If I change the onlick to do an alert() it works fine, so it’s not an issue with JS per se. Any ideas?
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
- The topic ‘Javascript Show/Hide in widget options’ is closed to new replies.