I’ve been at this for a while and can’t find a working JS solution. I have several forms on a page that are similar to this one. They’ll each pull a list from a database as a lookup field. The user can start typing to find matching entries; however, I’d like to disable the option for the form to submit if the typed entry doesn’t exist in the list.
<form method="post" action="script.php">
<div class="wtitle">Edit/Lookup</div>
<script>
$(function() {
var availableTags = [
"testentry.com","example.com","yoursite.com","mysite.com"
];
$( "#tags3" ).autocomplete({
source: availableTags
});
});
</script>
<input class="wtext" id="tags3" name="site" placeholder="Search by Site Name" required>
<div class="wbutton">
<button type="submit" class="btn btn-success fa wbutton">SUBMIT</button>
</div>
</form>
Here’s a live link:
https://goo.gl/Xmgoxe
Any thoughts would be helpful! Thank you!