Menu icon Foundation
reveal modal in select function of autocomplete?

Hello,

Just wondering if someone could help me figure out how to fire a modal from an autocomplete selection?

$("#coolac").autocomplete({
source: "search1.php",
focus: function(event, ui) {
// prevent autocomplete from updating the textbox
event.preventDefault();
// manually update the textbox
$(this).val(ui.item.label);
},

select: function(event, ui) {
// prevent autocomplete from updating the textbox
event.preventDefault();            
//FIRE MODAL #myModal HERE???????
},         

jqueryautocompletereveal

Hello,

Just wondering if someone could help me figure out how to fire a modal from an autocomplete selection?

$("#coolac").autocomplete({
source: "search1.php",
focus: function(event, ui) {
// prevent autocomplete from updating the textbox
event.preventDefault();
// manually update the textbox
$(this).val(ui.item.label);
},

select: function(event, ui) {
// prevent autocomplete from updating the textbox
event.preventDefault();            
//FIRE MODAL #myModal HERE???????
},         
Geoff Kimball over 5 years ago

You can trigger the opening and closing of any Reveal modal with this code:

// Open a modal
$('#myModal').foundation('reveal', 'open');
// Close a modal
$('#myModal').foundation('reveal', 'close');