I have created a simple frontend form to allow users to submit posts – similar to the tutorial here – http://voodoopress.com/ . I also have a couple of custom taxonomies which i have as text input boxes on my form. This is all working but i was wondering if there is anyway i can have all the fields including Post Title and the taxonomies to auto suggest existing values?
thanks
Ok not sure if this is the best method to use but it worked for me. I used a combition of jquery-ui-autocomplete – and the JSON API plugin
First download the required js files from the link above. I used jqueri-ui from the Google library
Install and activate JSON API plugin
I then used the following javascript to auto suggest when typing into the “title” input field on my custom post form
<script type="text/javascript">
$(function() {
$('#title').autocomplete({
source: function( request, response ) {
$.ajax({
url: "http://example.com/?json=1&include=title",
dataType: "json",
data: {
featureClass: "P",
style: "full",
maxRows: 12,
name_startsWith: request.term
},
success: function( data ) {
response( $.map( data.posts, function( item ) {
return {
label: item.title,
value: item.title
}
}));
}
});
},
minLength: 2,
});
});
</script>
Next step is to get this working with custom taxonomies!