How do I add a new value that is not already selected? I have set the 'no_results_text' to display an <a>
tag, and it's working fine.
$('#secondary_diagnosis').chosen({no_results_text: '<a onclick="add_new_diagnosis()">Save as New </a>'});
https://i.sstatic.net/I4lYo.png
This is my current code:
However, when I try to add a new value that is part of the existing values, the 'no_results_text' doesn't show. I need a solution to call my predefined function add_new_diagnosis()
.
Is there a way to include <a>
tags on the chosen-search-input
field?
https://i.sstatic.net/MumBi.png
Here is the current code snippet:
<select class="col-md-11" name="secondary_diagnosis" id="secondary_diagnosis"
class="form-control chosen" title="Diagnosis">
<option value="0">Other</option>
<option value="0">other retinal</option>
<option value="0">Couch</option>
<option value="0">Fever</option>
</select>
window.onload = function () {
$('#secondary_diagnosis').chosen({no_results_text: '<a onclick="add_new_diagnosis()">Save as New </a>'});
}