I'm thinking of adding jqueryUi autocomplete to my site, few questions I can't find an answer to:
- Can I remove/replace the the ul tag which holds the responses? I managed to replace the li tags with tr but those are not suppose to be inside a ul tag
Please refer following link: may be this is useful for you.
How to change input type dynamically using jquery or javascript
Related
I am using tag-it for my application. My requirement is that I should create tag-it tags and put these tags in a textarea element. I am choosing textarea over input because textarea can support newline.
I have gone through http://aehlke.github.io/tag-it/examples.html, but I notice that it supports only input element. I have also played around with the code and noticed the same.
Does tag-it work on textarea HTML element?
Looking forward to your response
The tag-it library works on input elements. One would, perhaps, have to modify their library in order to accommodate the textarea element.
Another alternative for tag-it would be to use tageditor library https://goodies.pixabay.com/jquery/tag-editor/demo.html as they support textarea HTML elements as well
I have been using ng-tagsinput from benford -> http://mbenford.github.io/ngTagsInput/
I am trying to add tooltips for tags added in input field. This tooltip should show contents of the tag. Can anyone help me to add tooltips for the tag?
Any help is appreciated.
Thank you,
I have made little changes in latest file of ng-tags-input.js and ng-tags-input.min.js that will solve your requirement of tool tip.
I have added ng-attr-title={{$getDisplayText()}} at ngTagsInput/tag-item.html template section in js file. by simply adding title attribute to the span tag will work. This change made for you, but #mbenford the creator of this library may add this as an feature.
You can download the file from below links. and you can see the tooltip on tags :)
https://ufile.io/k5v8w - min js
https://ufile.io/sntbh - unminified js
This is a very old question but a template approach is better. Just use the "template" attribute and add tooltip to your template. Details here:
http://mbenford.github.io/ngTagsInput/documentation/guides/custom-templates
I am using Django and the django-dynamic-formset plugin to generate a JQuery Mobile (JQM) site. I have nested forms that allow the user to click a "Add" link to another line to the form. This works great without JQM, but when JQM is used to style the form widgets the radio button labels do not trigger the correct radio button.
I have put up a static example of the behaviour, based on the generated HTML. Click the "Add" link, then try choosing a severity for the added item. The "for" attributes of the labels appear to update correctly, so I do not know what I'm doing wrong.
The django-dynamic-formset guide provides me with a way to call a JavaScript function after the user clicks the "Add" button, but I do not know if there's a JQM method I should be calling that will fix the issue. When I use JQM's enhanceWithin function it triggers a page load, which submits my form to Django, which I don't want at that point because the form won't validate yet.
Edit: I uploaded a much better example to the same URL.
After enough caffeine and peanut M&M's I have figured it out.
Reason for Failure: The django-dynamic-formset (DDF) plugin duplicates the form you give it. But the form is cloned as-is, which already includes all the JQuery Mobile (JQM) processing. This causes JQM to ignore it and makes the radio buttons misbehave.
The Solution: The DDF plugin allows you to specify what form to clone by its formTemplate parameter. JQM allows you to disable automatic mobile-enhancement of certain elements. Create an un-enhanced version of your form, and pass that to DDF as your formTemplate.
More Details:
I put this coded into my HTML head, before the reference to JQM:
<script>
$(document).bind('mobileinit',function(){
$.mobile.ignoreContentEnabled = true; // required for using the natural forms
});
</script>
And included this style to hide my "natural" form:
<style>
.natural-form { visibility: hidden; display: none; }
</style>
In the Django code I added a <div class='natural-form> and put a dummy version of my form in it (being sure to surround it another <div> with a unique ID for reference later). In my initialization of DDF I give it the unique ID as the parameter to formTemplate.
I was told on another forum I would have to hack DDF and JQM to get this to work. I am impressed at the design of both of these libraries - flexible enough that a newbie to JQuery can stick all the pieces in the right places and get something out of it.
In jquery mobile, you deal with data-roles a lot. Is there a list of all data-roles in jquery-mobile? I think I would find that helpful.
After the 1.0 release there is now an official reference page for data attributes (including roles).
This is the best list I can find.
source: http://api.jquerymobile.com/data-attribute/
data-add-back-btn
data-ajax
data-back
data-back-btn-text
data-collapsed
data-count-theme
data-direction
data-divider-theme
data-dividertheme
data-filter
data-filter-theme
data-fullscreen
data-grid
data-icon
data-iconpos
data-id
data-inline
data-inset
data-mynamespace-foo
data-native
data-native-menu
data-placeholder
data-position
data-rel
data-role
data-split-icon
data-split-theme
data-theme
data-track-theme
data-transition
data-type
data-url
As Joe says, the documentation is hard to navigate we most developers are used to do.
There is not all possible values for data-role attribute documented.
You have to figure it out by reading the whole page.
So in my willing to help, this is what I got from documentation page:
data-role possible values:
button
collapsible
collapsible-set
content
field-contain
slider
footer
header
listview
navbar
page
hope this helps, hope jquery update its doc page.
You can add your own data-role values for styling and extension purposes.
How do I get jQuery autocomplete to show <a> tags?
I'm using jQuery autocommit to search names. I would like the dropdown returned from the Server to include HTML, specifically <a> tags, so I can return the name and the email and the company each within an <a> tag.
Currently, the HTML that I return from the server is displayed in the autcommit dropdown as text and doesn't act as HTML?
Take a look at this, and see if it helps: http://forum.jquery.com/topic/using-html-in-autocomplete