Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
in Q2A Core by
OK after of many many hours of  trying finally i am giving up.

I need your help !!!!!!!!!!

What i want to di is  to add the input field "tags" on second position on my site at the sidebar.

I found that when you add a new question the q2a platform uses the file qa-app-format.php and the javascript file qa-ask.js

However i tried to use that code

<input type="text" class="tags_field" value="" onmouseup="qa_tag_hints();" onkeyup="qa_tag_hints();" autocomplete="off" placeholder="Tags - use hyphens to combine words:" id="tags" name="tags">

and after i called the file qa-ask.js,

the code above displays the tags input field but the tags auto suggestion doesnt work. Can anyone of the experienced users gives me some instructions on how to duplicate the tags field with working tags auto suggestion function ?


Best Regards
Q2A version: 1.6.3

2 Answers

0 votes

Probably the snippet you're duplicating is partial.

Try to duplicate

<td class="qa-form-tall-data">
<input name="tags" id="tags" autocomplete="off" onkeyup="qa_tag_hints();" onmouseup="qa_tag_hints();" type="text" value="" class="qa-form-tall-text">
<div class="qa-form-tall-note"><span id="tag_examples_title" style="display: none;">Example tags: </span><span id="tag_complete_title" style="">Matching tags: </span><span id="tag_hints"><a href="#" class="qa-tag-link" onclick="return qa_tag_click(this);"><span style="font-weight:normal;"><b>te</b>st</span></a> </span></div>
Still doesnt work. Also when i am using the "tags" id on my custom field it stops working at the same time and the normal core tags field on the add question page.

Any suggestion will be apreciatted.

0 votes
1. Why do you need it in the sidebar additionally?
2. If you duplicate it, Javascript might not know where to target the suggested example tags.

I think you either move the entire tags field. Or you write a second jquery/javascript function (actually a copy of the suggest tags function) that targets the duplicated field.
i want to use it as a search field so i can force users to select one of the tags when they serch on my site ;)