Calling $(element).typeahead('val') returns Undefined
See original GitHub issueCurrently not possible to get the value of typeahead input as the .typeahead('val')
reurns Undefined
.
console.log($(this).typeahead('val', 'val')); // this works, value is set to 'val'
console.log($(this).typeahead('val')); // returns `Undefined`
Issue Analytics
- State:
- Created 9 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
typeahead.js get input value on button click - Stack Overflow
I am having problems as the $('.typeahead').typeahead('val') method doesn't seem to be working at all (error: undefined). trying $('.typeahead') ...
Read more >Javascript – Twitter Bootstrap typeahead: get context / calling ...
I am trying to access the text box element from within typeahead's updater function. Here is my current code, which works great:
Read more >typeahead this.$element.val(...).text is not a function - jQWidgets
I am using the EditDialog in the Scheduler. When the dialog is created: var SaleEnquiryRefField = “<div>”;
Read more >jQuery Typeahead Search Configuration - RunningCoder
Call the $.typeahead() function with the input option configured ... null , // Set the input value template when an item is clicked...
Read more >jquery typeahead - Christopher Baines
jQuery#typeahead('val'). Returns the current value of the typeahead. The value is the text the user has entered into the input element.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The issue still exist v 0.11.1
always undefined to me too, using $(‘.typeahead’) selector @thedavidscherer, i ended up using, as a quick-fix, the class .tt-input (following the markup created by the plugin)