GithubHelp home page GithubHelp logo

Comments (7)

scottgonzalez avatar scottgonzalez commented on June 9, 2024

That's not an adequate description. You don't even have sample code here.

from jquery-ui-extensions.

stephaneeybert avatar stephaneeybert commented on June 9, 2024

Hi Scott,

I didn't know ifI should paste thewhole example code or not.

Here it is:

<!doctype html>

<title>jQuery UI Autocomplete Extension - HTML Option</title>
<link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.17/themes/base/jquery-ui.css">

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.17/jquery-ui.js"></script>
<script src="jquery.ui.autocomplete.html.js"></script>
<script>
  $(function() {
    $("#autocomplete").autocomplete({
      source: [
      {
        label: "aardvark", 
        value: "aardvark"
      },
      {
        label: "<b>apple</b>",
        value: "apple"
      },
      {
        label: "<i>atom</i>",
        value: "atom"
      }
      ],
      minLength: "2",
      html: true
    });
  });
</script>
<input id="autocomplete">

from jquery-ui-extensions.

stephaneeybert avatar stephaneeybert commented on June 9, 2024

I tried to attach it to the thread but maybe it's not possible.

I then removed the minLength property from my own application code, thinking it would now work fine with the html content, but it did not.

Here is the code I have in my application:

$().ready(function() {

$("#$textFieldId").keyup(function() {
if (!this.value) {
$("#$hiddenFieldId").attr("value", '-1');
$("#$textFieldId").attr("value", '');
}
});

$("#$textFieldId").autocomplete({
source: "$url",
minLength: $minChar,
html: true,
select: function(event, ui) {
if (ui.item) {
$("#$hiddenFieldId").attr("value", ui.item.id);
}
}
});

});

from jquery-ui-extensions.

scottgonzalez avatar scottgonzalez commented on June 9, 2024

Why are you using a string for minLength?

from jquery-ui-extensions.

scottgonzalez avatar scottgonzalez commented on June 9, 2024

Please provide a usable test case using jsFiddle or jsbin.

from jquery-ui-extensions.

stephaneeybert avatar stephaneeybert commented on June 9, 2024

At first I was not, but then tried with a string see if it would help. Will provide a jsFiddle example.

Sent from my iPod

On 22 févr. 2012, at 22:35, Scott González [email protected] wrote:

Why are you using a string for minLength?


Reply to this email directly or view it on GitHub:
#8 (comment)

from jquery-ui-extensions.

stephaneeybert avatar stephaneeybert commented on June 9, 2024

Hi Scott

I saved a jsFiddle to notice my mistake.
Hard to believe.. or not, wrong path url to your plugin in my code. It works indeed. Sorry for that.

Steph

Sent from my iPod

On 22 févr. 2012, at 22:37, Scott González [email protected] wrote:

Please provide a usable test case using jsFiddle or jsbin.


Reply to this email directly or view it on GitHub:
#8 (comment)

from jquery-ui-extensions.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.