Is there a good way to ensure that the user has selected a value from the drop-down list created by the auto-completer? We have a situation where users are not selecting from the list and the entered value in the input box is not valid. Deco --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---
Hey, Deco Rior a écrit :> Is there a good way to ensure that the user has selected a value from > the drop-down list created by the auto-completer?Why don''t you just validate that the initial, invalid value is gone before submitting your data to the server (whether by vanilla or AJAX ways)? -- Christophe Porteneuve aka TDD tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---
The action is equivalent to "force selection" in the Yahoo library It of course needs to be real time. I can add a validation script to ensure that a value was entered, but was kind of suprised I could not find an elegant extension of this in autocompleter Deco On Nov 2, 2006, at 7:20 AM, Christophe Porteneuve wrote:> > Hey, > > Deco Rior a écrit : >> Is there a good way to ensure that the user has selected a value from >> the drop-down list created by the auto-completer? > > Why don''t you just validate that the initial, invalid value is gone > before submitting your data to the server (whether by vanilla or > AJAX ways)? > > -- > Christophe Porteneuve aka TDD > tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---
Hey there, Deco Rior a écrit :> The action is equivalent to "force selection" in the Yahoo libraryI have no idea what this does. Can you elaborate? -- Christophe Porteneuve aka TDD tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---
On 11/2/06, Deco Rior <decorior-w9xKMqPX1QdNhnlO7+U8Og@public.gmane.org> wrote:> was kind of suprised I could not find an elegant extension of this in > autocompleterThe best explanation: No one needed this so far. Bye, Martin --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---
:-) Well there you have it! It is pretty easy for me to solve. I will just validate either on change of before form submission. Deco On Nov 2, 2006, at 7:54 AM, Martin Bialasinski wrote:> > On 11/2/06, Deco Rior <decorior-w9xKMqPX1QdNhnlO7+U8Og@public.gmane.org> wrote: > >> was kind of suprised I could not find an elegant extension of this in >> autocompleter > > The best explanation: No one needed this so far. > > Bye, > Martin > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---
Thought it was easy but not so. Here is the problem... The user enters in a partial name , e.g. Rio It brings up a list but the user does not select from the list When I submit it to a form I have a value that has multiple matches. I need to check the user has selected a value. I cannot use afterUpdateElement since it only works after the selection. Any ideas? Deco On Nov 2, 2006, at 8:53 AM, Deco Rior wrote:> > :-) > > Well there you have it! > > It is pretty easy for me to solve. > > I will just validate either on change of before form submission. > > Deco > > On Nov 2, 2006, at 7:54 AM, Martin Bialasinski wrote: > >> >> On 11/2/06, Deco Rior <decorior-w9xKMqPX1QdNhnlO7+U8Og@public.gmane.org> wrote: >> >>> was kind of suprised I could not find an elegant extension of >>> this in >>> autocompleter >> >> The best explanation: No one needed this so far. >> >> Bye, >> Martin >> >>> > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Hi Deco... I am having the same problem right now, as well with the autocompleter you helped me set up eons ago. I''ll be interested to hear about a solution on this! sqe On Nov 11, 2006, at 12:25 PM, Deco Rior wrote:> > Thought it was easy but not so. > > Here is the problem... > > The user enters in a partial name , e.g. Rio > > It brings up a list but the user does not select from the list > > When I submit it to a form I have a value that has multiple matches. > > I need to check the user has selected a value. > > I cannot use afterUpdateElement since it only works after the > selection. > > Any ideas? > > Deco > On Nov 2, 2006, at 8:53 AM, Deco Rior wrote: > >> >> :-) >> >> Well there you have it! >> >> It is pretty easy for me to solve. >> >> I will just validate either on change of before form submission. >> >> Deco >> >> On Nov 2, 2006, at 7:54 AM, Martin Bialasinski wrote: >> >>> >>> On 11/2/06, Deco Rior <decorior-w9xKMqPX1QdNhnlO7+U8Og@public.gmane.org> wrote: >>> >>>> was kind of suprised I could not find an elegant extension of >>>> this in >>>> autocompleter >>> >>> The best explanation: No one needed this so far. >>> >>> Bye, >>> Martin >>> >>>> >> >> >>> > > > > >Steven Q. Evans Director of Technological Resources MSI Productions (858)344-3351 • (858)348-0629 • (707)215-1032 Fax • sqevans-HnJwFksjYctBDgjK7y7TUQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Yahoo has this option in their autocompleter Deco On Nov 11, 2006, at 4:28 PM, Steven Q. Evans wrote:> > Hi Deco... > > I am having the same problem right now, as well with the > autocompleter you helped me set up eons ago. I''ll be interested to > hear about a solution on this! > > sqe > > On Nov 11, 2006, at 12:25 PM, Deco Rior wrote: > >> >> Thought it was easy but not so. >> >> Here is the problem... >> >> The user enters in a partial name , e.g. Rio >> >> It brings up a list but the user does not select from the list >> >> When I submit it to a form I have a value that has multiple matches. >> >> I need to check the user has selected a value. >> >> I cannot use afterUpdateElement since it only works after the >> selection. >> >> Any ideas? >> >> Deco >> On Nov 2, 2006, at 8:53 AM, Deco Rior wrote: >> >>> >>> :-) >>> >>> Well there you have it! >>> >>> It is pretty easy for me to solve. >>> >>> I will just validate either on change of before form submission. >>> >>> Deco >>> >>> On Nov 2, 2006, at 7:54 AM, Martin Bialasinski wrote: >>> >>>> >>>> On 11/2/06, Deco Rior <decorior-w9xKMqPX1QdNhnlO7+U8Og@public.gmane.org> wrote: >>>> >>>>> was kind of suprised I could not find an elegant extension of >>>>> this in >>>>> autocompleter >>>> >>>> The best explanation: No one needed this so far. >>>> >>>> Bye, >>>> Martin >>>> >>>>> >>> >>> >>>> >> >> >>> >> > > Steven Q. Evans > Director of Technological Resources > MSI Productions > (858)344-3351 • (858)348-0629 • (707)215-1032 Fax • > sqevans-HnJwFksjYctBDgjK7y7TUQ@public.gmane.org > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Actually, I do catch it easily on the submission, but that is soooooooo Web 1.0 :-) Deco On Nov 11, 2006, at 4:28 PM, Steven Q. Evans wrote:> > Hi Deco... > > I am having the same problem right now, as well with the > autocompleter you helped me set up eons ago. I''ll be interested to > hear about a solution on this! > > sqe > > On Nov 11, 2006, at 12:25 PM, Deco Rior wrote: > >> >> Thought it was easy but not so. >> >> Here is the problem... >> >> The user enters in a partial name , e.g. Rio >> >> It brings up a list but the user does not select from the list >> >> When I submit it to a form I have a value that has multiple matches. >> >> I need to check the user has selected a value. >> >> I cannot use afterUpdateElement since it only works after the >> selection. >> >> Any ideas? >> >> Deco >> On Nov 2, 2006, at 8:53 AM, Deco Rior wrote: >> >>> >>> :-) >>> >>> Well there you have it! >>> >>> It is pretty easy for me to solve. >>> >>> I will just validate either on change of before form submission. >>> >>> Deco >>> >>> On Nov 2, 2006, at 7:54 AM, Martin Bialasinski wrote: >>> >>>> >>>> On 11/2/06, Deco Rior <decorior-w9xKMqPX1QdNhnlO7+U8Og@public.gmane.org> wrote: >>>> >>>>> was kind of suprised I could not find an elegant extension of >>>>> this in >>>>> autocompleter >>>> >>>> The best explanation: No one needed this so far. >>>> >>>> Bye, >>>> Martin >>>> >>>>> >>> >>> >>>> >> >> >>> >> > > Steven Q. Evans > Director of Technological Resources > MSI Productions > (858)344-3351 • (858)348-0629 • (707)215-1032 Fax • > sqevans-HnJwFksjYctBDgjK7y7TUQ@public.gmane.org > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
My solution to making sure a valid value has been entered into an autocomplete is to include a hidden field on the page that stores the id of the object selected. To start, the hidden field is empty, but when I start typing and then select a valid option, I set the value of the hidden field to the id associated with the selected option from the autocomplete. If the text in the autocomplete changes, I set the hidden field to blank and set it back to a valid id when another valid option is selected from the autocomplete. Then on form submission if the hidden field is blank then I show a message saying that no valid entry has been selected, otherwise the hidden field has an id and is submitted along with the form. Anyway, this is what I''ve done and it works just fine. On 11/11/06, Deco Rior <decorior-w9xKMqPX1QdNhnlO7+U8Og@public.gmane.org> wrote:> > Actually, I do catch it easily on the submission, but that is > soooooooo Web 1.0 :-) > > Deco > On Nov 11, 2006, at 4:28 PM, Steven Q. Evans wrote: > > > > > Hi Deco... > > > > I am having the same problem right now, as well with the > > autocompleter you helped me set up eons ago. I''ll be interested to > > hear about a solution on this! > > > > sqe > > > > On Nov 11, 2006, at 12:25 PM, Deco Rior wrote: > > > >> > >> Thought it was easy but not so. > >> > >> Here is the problem... > >> > >> The user enters in a partial name , e.g. Rio > >> > >> It brings up a list but the user does not select from the list > >> > >> When I submit it to a form I have a value that has multiple matches. > >> > >> I need to check the user has selected a value. > >> > >> I cannot use afterUpdateElement since it only works after the > >> selection. > >> > >> Any ideas? > >> > >> Deco > >> On Nov 2, 2006, at 8:53 AM, Deco Rior wrote: > >> > >>> > >>> :-) > >>> > >>> Well there you have it! > >>> > >>> It is pretty easy for me to solve. > >>> > >>> I will just validate either on change of before form submission. > >>> > >>> Deco > >>> > >>> On Nov 2, 2006, at 7:54 AM, Martin Bialasinski wrote: > >>> > >>>> > >>>> On 11/2/06, Deco Rior <decorior-w9xKMqPX1QdNhnlO7+U8Og@public.gmane.org> wrote: > >>>> > >>>>> was kind of suprised I could not find an elegant extension of > >>>>> this in > >>>>> autocompleter > >>>> > >>>> The best explanation: No one needed this so far. > >>>> > >>>> Bye, > >>>> Martin > >>>> > >>>>> > >>> > >>> > >>>> > >> > >> > >>> > >> > > > > Steven Q. Evans > > Director of Technological Resources > > MSI Productions > > (858)344-3351 • (858)348-0629 • (707)215-1032 Fax • > > sqevans-HnJwFksjYctBDgjK7y7TUQ@public.gmane.org > > > > > > > > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
I have no problem on form submission checking for a value. I am looking to get feedback as soon as the person fails to click on the dropdown. What I want is as soon as the use types somewhere else it will check the value and see it was not selected. On Nov 11, 2006, at 5:00 PM, Andrew Kaspick wrote:> > My solution to making sure a valid value has been entered into an > autocomplete is to include a hidden field on the page that stores the > id of the object selected. > > To start, the hidden field is empty, but when I start typing and then > select a valid option, I set the value of the hidden field to the id > associated with the selected option from the autocomplete. If the > text in the autocomplete changes, I set the hidden field to blank and > set it back to a valid id when another valid option is selected from > the autocomplete. Then on form submission if the hidden field is > blank then I show a message saying that no valid entry has been > selected, otherwise the hidden field has an id and is submitted along > with the form. > > Anyway, this is what I''ve done and it works just fine. > > On 11/11/06, Deco Rior <decorior-w9xKMqPX1QdNhnlO7+U8Og@public.gmane.org> wrote: >> >> Actually, I do catch it easily on the submission, but that is >> soooooooo Web 1.0 :-) >> >> Deco >> On Nov 11, 2006, at 4:28 PM, Steven Q. Evans wrote: >> >>> >>> Hi Deco... >>> >>> I am having the same problem right now, as well with the >>> autocompleter you helped me set up eons ago. I''ll be interested to >>> hear about a solution on this! >>> >>> sqe >>> >>> On Nov 11, 2006, at 12:25 PM, Deco Rior wrote: >>> >>>> >>>> Thought it was easy but not so. >>>> >>>> Here is the problem... >>>> >>>> The user enters in a partial name , e.g. Rio >>>> >>>> It brings up a list but the user does not select from the list >>>> >>>> When I submit it to a form I have a value that has multiple >>>> matches. >>>> >>>> I need to check the user has selected a value. >>>> >>>> I cannot use afterUpdateElement since it only works after the >>>> selection. >>>> >>>> Any ideas? >>>> >>>> Deco >>>> On Nov 2, 2006, at 8:53 AM, Deco Rior wrote: >>>> >>>>> >>>>> :-) >>>>> >>>>> Well there you have it! >>>>> >>>>> It is pretty easy for me to solve. >>>>> >>>>> I will just validate either on change of before form submission. >>>>> >>>>> Deco >>>>> >>>>> On Nov 2, 2006, at 7:54 AM, Martin Bialasinski wrote: >>>>> >>>>>> >>>>>> On 11/2/06, Deco Rior <decorior-w9xKMqPX1QdNhnlO7+U8Og@public.gmane.org> wrote: >>>>>> >>>>>>> was kind of suprised I could not find an elegant extension of >>>>>>> this in >>>>>>> autocompleter >>>>>> >>>>>> The best explanation: No one needed this so far. >>>>>> >>>>>> Bye, >>>>>> Martin >>>>>> >>>>>>> >>>>> >>>>> >>>>>> >>>> >>>> >>>>> >>>> >>> >>> Steven Q. Evans >>> Director of Technological Resources >>> MSI Productions >>> (858)344-3351 • (858)348-0629 • (707)215-1032 Fax • >>> sqevans-HnJwFksjYctBDgjK7y7TUQ@public.gmane.org >>> >>> >>>> >> >> >>> >> > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Hey, Steve: I just figured it out! So easy! I will update later! On Nov 11, 2006, at 7:13 PM, Deco Rior wrote:> > I have no problem on form submission checking for a value. I am > looking to get feedback as soon as the person fails to click on the > dropdown. What I want is as soon as the use types somewhere else it > will check the value and see it was not selected. > On Nov 11, 2006, at 5:00 PM, Andrew Kaspick wrote: > >> >> My solution to making sure a valid value has been entered into an >> autocomplete is to include a hidden field on the page that stores the >> id of the object selected. >> >> To start, the hidden field is empty, but when I start typing and then >> select a valid option, I set the value of the hidden field to the id >> associated with the selected option from the autocomplete. If the >> text in the autocomplete changes, I set the hidden field to blank and >> set it back to a valid id when another valid option is selected from >> the autocomplete. Then on form submission if the hidden field is >> blank then I show a message saying that no valid entry has been >> selected, otherwise the hidden field has an id and is submitted along >> with the form. >> >> Anyway, this is what I''ve done and it works just fine. >> >> On 11/11/06, Deco Rior <decorior-w9xKMqPX1QdNhnlO7+U8Og@public.gmane.org> wrote: >>> >>> Actually, I do catch it easily on the submission, but that is >>> soooooooo Web 1.0 :-) >>> >>> Deco >>> On Nov 11, 2006, at 4:28 PM, Steven Q. Evans wrote: >>> >>>> >>>> Hi Deco... >>>> >>>> I am having the same problem right now, as well with the >>>> autocompleter you helped me set up eons ago. I''ll be interested to >>>> hear about a solution on this! >>>> >>>> sqe >>>> >>>> On Nov 11, 2006, at 12:25 PM, Deco Rior wrote: >>>> >>>>> >>>>> Thought it was easy but not so. >>>>> >>>>> Here is the problem... >>>>> >>>>> The user enters in a partial name , e.g. Rio >>>>> >>>>> It brings up a list but the user does not select from the list >>>>> >>>>> When I submit it to a form I have a value that has multiple >>>>> matches. >>>>> >>>>> I need to check the user has selected a value. >>>>> >>>>> I cannot use afterUpdateElement since it only works after the >>>>> selection. >>>>> >>>>> Any ideas? >>>>> >>>>> Deco >>>>> On Nov 2, 2006, at 8:53 AM, Deco Rior wrote: >>>>> >>>>>> >>>>>> :-) >>>>>> >>>>>> Well there you have it! >>>>>> >>>>>> It is pretty easy for me to solve. >>>>>> >>>>>> I will just validate either on change of before form submission. >>>>>> >>>>>> Deco >>>>>> >>>>>> On Nov 2, 2006, at 7:54 AM, Martin Bialasinski wrote: >>>>>> >>>>>>> >>>>>>> On 11/2/06, Deco Rior <decorior-w9xKMqPX1QdNhnlO7+U8Og@public.gmane.org> wrote: >>>>>>> >>>>>>>> was kind of suprised I could not find an elegant extension of >>>>>>>> this in >>>>>>>> autocompleter >>>>>>> >>>>>>> The best explanation: No one needed this so far. >>>>>>> >>>>>>> Bye, >>>>>>> Martin >>>>>>> >>>>>>>> >>>>>> >>>>>> >>>>>>> >>>>> >>>>> >>>>>> >>>>> >>>> >>>> Steven Q. Evans >>>> Director of Technological Resources >>>> MSI Productions >>>> (858)344-3351 • (858)348-0629 • (707)215-1032 Fax • >>>> sqevans-HnJwFksjYctBDgjK7y7TUQ@public.gmane.org >>>> >>>> >>>>> >>> >>> >>>> >>> >> >>> > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Hey Deco, I read your "I figured it out!" post, but here: - use afterUpdateElement to adjust a boolean (either global or associated as a custom property to the DOM object for the field) - react to onBlur to check for this boolean being true How''s that? -- Christophe Porteneuve a.k.a. TDD "[They] did not know it was impossible, so they did it." --Mark Twain Email: tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Well, I thought I had too! But I think the problem is this. When You select from the keyboard it is no problem. However, when you click on the dropdown, it will detect this as an onBlur/onChange event So the validation occurs before the values are looked up resulting in a failed response. soo close! Deco P.S. I did not try your approach so might be wrong. The trick is to change the value click outside the input box update the value and then trigger the validation On Nov 12, 2006, at 7:23 AM, Christophe Porteneuve wrote:> > Hey Deco, > > I read your "I figured it out!" post, but here: > > - use afterUpdateElement to adjust a boolean (either global or > associated as a custom property to the DOM object for the field) > - react to onBlur to check for this boolean being true > > How''s that? > > -- > Christophe Porteneuve a.k.a. TDD > "[They] did not know it was impossible, so they did it." --Mark Twain > Email: tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Hi, Just tested it! I need the ''focusout'' event. But Event.observe does not seem to recognize this? Deco On Nov 12, 2006, at 8:35 AM, Deco Rior wrote:> > Well, I thought I had too! > > But I think the problem is this. When You select from the keyboard it > is no problem. > > However, when you click on the dropdown, it will detect this as an > onBlur/onChange event > > So the validation occurs before the values are looked up resulting in > a failed response. > > soo close! > > Deco > > P.S. I did not try your approach so might be wrong. The trick is to > change the value click outside the input box update the value and > then trigger the validation > > On Nov 12, 2006, at 7:23 AM, Christophe Porteneuve wrote: > >> >> Hey Deco, >> >> I read your "I figured it out!" post, but here: >> >> - use afterUpdateElement to adjust a boolean (either global or >> associated as a custom property to the DOM object for the field) >> - react to onBlur to check for this boolean being true >> >> How''s that? >> >> -- >> Christophe Porteneuve a.k.a. TDD >> "[They] did not know it was impossible, so they did it." --Mark Twain >> Email: tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org >> >>> > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Hey Deco, Deco Rior a écrit :> I need the ''focusout'' event. But Event.observe does not seem to > recognize this?Well, first, the event name is ''DOMFocusOut'' [1]. Second, it is not, AFAIK, recognized yet by several browsers, most prominently IE. Third, it is semantically identical to ''blur''. So I fail to see how this helps you out. I believe you''ll have to hack around this, like: - Use a boolean stating whether suggestions are displayed, using the onShow/onHide callback functions. - Still use, as I described earlier, a boolean stating whether a value was selected (defaults to false, set to true through your afterUpdateElement callback). - Observe onblur, and validate only when your first boolean states no suggestions are displayed. Kinda tricky, but should do it. [1] http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-eventgroupings-uievents -- Christophe Porteneuve a.k.a. TDD "[They] did not know it was impossible, so they did it." --Mark Twain Email: tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks, Interesting though, it seems that onBlur does not change the focus of an input box, whereas onFocusOut is implied. So I am suprised that the behavior is the same. The lack of support across browser was a killer. Thanks for the suggestions, it looks like a hack is the only way to go. Any idea how YUI does this? Deco On Nov 12, 2006, at 9:16 AM, Christophe Porteneuve wrote:> > Hey Deco, > > Deco Rior a écrit : >> I need the ''focusout'' event. But Event.observe does not seem to >> recognize this? > > Well, first, the event name is ''DOMFocusOut'' [1]. Second, it is not, > AFAIK, recognized yet by several browsers, most prominently IE. > Third, > it is semantically identical to ''blur''. So I fail to see how this > helps > you out. > > I believe you''ll have to hack around this, like: > > - Use a boolean stating whether suggestions are displayed, using the > onShow/onHide callback functions. > - Still use, as I described earlier, a boolean stating whether a value > was selected (defaults to false, set to true through your > afterUpdateElement callback). > - Observe onblur, and validate only when your first boolean states no > suggestions are displayed. > > Kinda tricky, but should do it. > > [1] > http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events- > eventgroupings-uievents > > -- > Christophe Porteneuve a.k.a. TDD > "[They] did not know it was impossible, so they did it." --Mark Twain > Email: tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Deco Rior a écrit :> Interesting though, it seems that onBlur does not change the focus of > an input box, whereas onFocusOut is implied.I''m not getting what you mean.> So I am suprised that the behavior is the same.Descriptions in the DOM specs clearly point that way.> Any idea how YUI does this?I guess deep-diving (with a lot of oxygen reserve!) in their source code will tell you! -- Christophe Porteneuve a.k.a. TDD "[They] did not know it was impossible, so they did it." --Mark Twain Email: tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---