Now THIS :
> > $(...).autocomplete("result",function(event, data, formatted) {
> > // do something with your data or the formatted value
>
> > });
does actually work. Anyone can explain this to me? I have searched a
lot ... found only non-working stuff. Well at least its solved now.
Thanks Christian.
On 3 nov., 15:52, Neikius <[EMAIL PROTECTED]> wrote:
> This "result" thing has been giving me headaches. I dont seem to be
> able to make it work ... I tried a few different ways of doing it
> (technically I guess the same, lately I am starting to understand thus
> crazy oo-js)
>
> This should be basically cutting the cake here:
> $('#partner').autocomplete.result(function(event,data,formatted) {
> if(data)
> document.getElementById('partner_sifra').value = data[1];
>
> });
>
> But I get an error ... here:
> Napaka: $("#partner").autocomplete.resultisnotafunction
>
> Could be wrong version of scripts or something? I just downloaded the
> starter bundle I think - all inclusive.
>
> Still, I amnotbrave enough to go digg into the code yet.
>
> Any help appreciated (I will provide more info whether necessary).
>
> On 23 sep., 10:09, "Jörn Zaefferer" <[EMAIL PROTECTED]>
> wrote:
>
>
>
> > Okay, lets consider an example where you want to put a value that
> > isn't displayed into a hidden field:
>
> > $("#input").autocomplete().result(function(event, data) {
> > if (data) {
> > // lets assume that data is an array ["Value", "Key"]
> > $("#hidden").val(data[1]);
> > }
>
> > });
>
> > Jörn
>
> > On Tue, Sep 23, 2008 at 8:50 AM, Christian
>
> > <[EMAIL PROTECTED]> wrote:
>
> > > Sorry, I mean can you explan this part a littlebit more
>
> > > "
> > > To react to a selected input, use theresultmethod:
>
> > >> $(...).autocomplete("result",function(event, data, formatted) {
> > >> // do something with your data or the formatted value
>
> > >> });
> > > "
>
> > > Best regards
>
> > > On 22 Sep., 14:37, "Jörn Zaefferer" <[EMAIL PROTECTED]>
> > > wrote:
> > >> You can specifcy the parse-option to parse the Ajax response. The
> > >> implementation for parsing JSON looks like this:
>
> > >> parse:function(data) {
> > >> return $.map(eval(data),function(row) {
> > >> return {
> > >> data: row,
> > >> value: row.name,
> > >> result: row.name + " <" + row.to
> > >> + ">"
> > >> }
> > >> });
> > >> },
>
> > >> "value" gets displayed in the select box, "result" is what ends up in
> > >> the input field. "data" is relevant for your callback, as we see
> > >> below.
>
> > >> To react to a selected input, use theresultmethod:
>
> > >> $(...).autocomplete("result",function(event, data, formatted) {
> > >> // do something with your data or the formatted value
>
> > >> });
>
> > >> To force a matching value, set mustMatch:true.
>
> > >> Jörn
>
> > >> On Mon, Sep 22, 2008 at 12:03 PM, Christian
>
> > >> <[EMAIL PROTECTED]> wrote:
>
> > >> > Hi,
>
> > >> > I hope someone from you can help me.
>
> > >> > I try to work with theAutoCompleteUI Feature and dynamic data.
> > >> > I work with ASP.NET MVC.
>
> > >> > My first problem is I call a JSON Method and she returned the String
> > >> > "Hallo|Wert1\r\nHallo2|Wert2\r\n" (My HTTP Sniffer said)
> > >> > So, theextendershow only "Hallo if I type H, so how do I format the
> > >> > JSONResultthat theextendershowsnotthe quotes and show both
> > >> > Hallo's andnotonly the first one?
>
> > >> > My second question is how do I react one the event if somebody
> > >> > selected one of the items with mouse or Enter button, because I want
> > >> > then execute a JSfunctionthat enable me a second select box and do
> > >> > some other stuff.
>
> > >> > The third and last question is, how can I make safe that the user
> > >> > selects one of the items and don't write crap into the box?
>
> > >> > I realy realy hope that someone can help me on one or more of my
> > >> >questions.
>
> > >> > Best regards
> > >> > Christian
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"jQuery UI" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/jquery-ui?hl=en
-~----------~----~----~----~------~----~------~--~---