How can in the same time search and write in a select drop down menu in general the select drop down menu we can't write in side is there a method can i use it to write inside this drop down menu and during typing if it contain a similar word appear if not i can continue writing and save this info into database
<select name='Name'>
<option value=""></option>
<option value="Mark">Mark</option>
<option value="alin">alin</option>
</select>
in this example if i write mark mark appear and i choose it in i write sami i dont have this name i can write and submit my form and it will be in the database
You can use this:
<html>
<head>
<script src="https://code.jquery.com/jquery-2.1.1.min.js" type="text/javascript"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.1/css/select2.min.css" rel="stylesheet" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.1/js/select2.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
var country = ["Australia", "Denmark", "Hong Kong", "India", "Indonesia", "Netherlands", "New Zealand", "South Africa"];
$("#country").select2({
data: country
});
});
</script>
</head>
<body>
<h1>DropDown with Search using jQuery</h1>
<div>
<select id="country" style="width:300px;">
<!-- Dropdown List Option -->
</select>
</div>
</body>
</html>