Question [SOLVED] Autocomplete with html in title
- UksusoFF
- Topic Author
- Offline
- Junior Member
Less
More
7 years 2 weeks ago - 7 years 2 weeks ago #1
by UksusoFF
Autocomplete with html in title was created by UksusoFF
Hi!
I try create text input with autocomplete. How enable html in titles?
I see that webtrees extend default jQuery UI Autocomplete and add html: true options for that.
But on dynamic created inputs it's not working. Why?
What I try:
Result:
I try create text input with autocomplete. How enable html in titles?
I see that webtrees extend default jQuery UI Autocomplete and add html: true options for that.
But on dynamic created inputs it's not working. Why?
What I try:
Code:
$('.pnwim-dialog').find('[name="pid"]').autocomplete({
html: true,
source: function(request, response) {
$.getJSON('autocomplete.php', {
field: 'INDI',
term: request.term
}, response);
}
})
Result:
Last edit: 7 years 2 weeks ago by UksusoFF.
Please Log in or Create an account to join the conversation.
- fisharebest
- Offline
- Administrator
7 years 2 weeks ago #2
by fisharebest
Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net
Replied by fisharebest on topic Autocomplete with html in title
1) Did you try using same code that webtrees uses?
2) webtrees 1.8 will use select2.github.io instead of jqueryui-autocomplete.
Code:
autocomplete(".pnwim-dialog [name=pid]");
2) webtrees 1.8 will use select2.github.io instead of jqueryui-autocomplete.
Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net
Please Log in or Create an account to join the conversation.
- UksusoFF
- Topic Author
- Offline
- Junior Member
7 years 2 weeks ago - 7 years 2 weeks ago #3
by UksusoFF
Same here.
As I can see webtrees autocomplete is simple wrapper with data attributes pass to request:
github.com/fisharebest/webtrees/blob/mas....9/webtrees.js#L1115
Replied by UksusoFF on topic Autocomplete with html in title
Okay, let's try.fisharebest wrote: 1) Did you try using same code that webtrees uses?
Code:
$('body').append('<input type="text" name="pid" class="ui-autocomplete-input ui-widget-content" data-autocomplete-type="INDI">');
autocomplete('[name="pid"]');
As I can see webtrees autocomplete is simple wrapper with data attributes pass to request:
github.com/fisharebest/webtrees/blob/mas....9/webtrees.js#L1115
Last edit: 7 years 2 weeks ago by UksusoFF.
Please Log in or Create an account to join the conversation.
- UksusoFF
- Topic Author
- Offline
- Junior Member
7 years 4 days ago #4
by UksusoFF
Replied by UksusoFF on topic Autocomplete with html in title
Any ideas?
Please Log in or Create an account to join the conversation.
- UksusoFF
- Topic Author
- Offline
- Junior Member
6 years 11 months ago #5
by UksusoFF
Replied by UksusoFF on topic Autocomplete with html in title
I found working snippet:
stackoverflow.com/a/3490609/2425504
Please Log in or Create an account to join the conversation.
- UksusoFF
- Topic Author
- Offline
- Junior Member
6 years 11 months ago #6
by UksusoFF
Replied by UksusoFF on topic [SOLVED] Autocomplete with html in title
Problem solved.
Please Log in or Create an account to join the conversation.