[eluser]Wayne Smallman[/eluser]
Hi Mike!
I've added the new code (with variable names changed) and it's still not working.
So the jQuery is:
Code:
function lookup(inputString) {
if(inputString.length < 3) {
// Hide the suggestion box.
$('#suggestions').hide();
} else if(inputString.length >= 3) {
$.post("http://macbookpro.local/development/theundercloud/tags/suggest", {
queryString: ""+inputString+""
}, function(data){
if(data.length > 0) {
$('#suggestions').show();
$('#autoSuggestionsList').html(data);
}
});
}
} // end function lookup
$(document).ready(function() {
$(function() {
$(".tag-add").click(function() {
var $clickText = $(this).text()
$("#tags").val($("#tags").val() + $clickText);
return false;
});
});
});
And for the view, I have:
Code:
<?php
if (count($this->arrayAttr['results']['select_tags']['tags']) > 0):
?> <ul>
<?php
foreach ($this->arrayAttr['results']['select_tags']['tags'] as $keyword):
?><li class="tag-add"><?php echo urldecode($keyword['tag']); ?></li><?php
endforeach;
?> </ul>
<?php
endif;
?>
The view is showing the list appearing fine, but clicking just doesn't do anything, sadly.