Possible Duplicate:
$ not defined using jQuery in Wordpress
Ok, so I'm having some trouble here. I'm customizing a plugin. I need a text field to automatically populate with the text of a drop down menu when an option is selected. The ID's of both elements are created on age load via php; however the IDs do not change. The id for the is "field_new_post_category" and the id of the text field is "post_title" This is what I have so far:
<script type='text/javascript'>//<![CDATA[
$(function(){
$(document).ready(function(){
$("#field_new_post_category").change(function(){
$("#post_title").val($(this).find("option:selected").text());
});
});
});//]]>
</script>
<select name="field_new_post_category" id="field_new_post_category" class="categoriesBox">
<option class="level-0" value="1">Main Category</option>
<option class="level-1" value="5"> sub-category</option>
<option class="level-2" value="7"> sub-sub-category</option>
</select>
<input type="text" id="post_title" class="span5" name="post_title" value="Campaign Title" readonly="readonly"/>
I have this working well in a JSFiddle here: http://jsfiddle.net/XVDH2/39/
The trouble is that when I put it all together in Wordpress, it doesn't work. Simply nothing. I make the selection and nothing changes.
Thanks for any help you might be able to offer. :)
-Chase

admin.phpdoes not exist. – brasofilo Dec 11 '12 at 11:07