Hi, I would like to have a drop down menu with jQuery show and hide the different divs (or textareas) below it. Here's my jQuerycode at the moment:
$(document).ready(function(){
$('#edit1').hide();
$('#edit2').hide();
$("#page_selection").change(function(){
$("#" + this.value).show().siblings().hide();
});
$("#page_selection").change();
});
And html:
<p>
<select id="page_selection">
<option value="edit1">About All</option>
<option value="edit2">Home Introduction</option>
</select>
<form method="post" action="page_edit_action.php" />
<div name="about_all" id="edit1"><?php echo $content['about_all'] ?></div>
<div name="home_introduction" id="edit2"><?php echo $content['home_introduction'] ?></div>
</form>
</p>
This code isn't changing when I choose a different option in the drop down menu.
If possible, I'd like to change the divs to textareas. Thanks :). (BTW, the php arrays have content, feel free to replace with your own placeholder)