Strip HTML tags from autocomplete field I have altered #autocomplate_path for node queue autocomplete node suggestions to show image field along with title and nid, which is working fine. The code which is returns the image with title and nid is.

$matches[$node-&gt;nid] = theme('image_style', array('style_name' =&gt; $get_image_field_style, 'path' =&gt; $image_field_uri, 'attributes' =&gt; array('class' =&gt; array('nodequeue-runsheets-images'))))
              . check_plain($node-&gt;title)
              . " [nid: $id]";


This is how I see the results with the above working code: -

The problem comes when drupal autocomplete pull the selected suggestions and populate it to autocomplete textfield. I see the html tags as . How can I override this to show only node title and mid.

The problem:
The solution in following post worked for me
http://www.derreklemar.net/tutorial/drupal-autocomplete-overriding-default-select-event-behavior