Loading ...
Sorry, an error occurred while loading the content.

Submit when selected from list AUTOCOMPLETE

Expand Messages
  • THECREW
    Is there a way to have the form submit when the selection has been made from the autocomplete list? instead of filling in the form field then having to click
    Message 1 of 2 , Jul 31, 2006
    View Source
    • 0 Attachment
      Is there a way to have the form submit when the selection has been
      made from the autocomplete list? instead of filling in the form field
      then having to click on submit?
    • djfep
      ... I sent this earlier but it did not seem to go through. Yes. Add a handler to listen to itemSelectEvent: // oAutoComp is the auto complete object
      Message 2 of 2 , Aug 2, 2006
      View Source
      • 0 Attachment
        --- In ydn-javascript@yahoogroups.com, "THECREW" <jim@...> wrote:
        >
        > Is there a way to have the form submit when the selection has been
        > made from the autocomplete list? instead of filling in the form field
        > then having to click on submit?
        >

        I sent this earlier but it did not seem to go through.

        Yes. Add a handler to listen to itemSelectEvent:

        // oAutoComp is the auto complete object
        oAutoComp.itemSelectEvent.subscribe(myOnItemSelect);

        function myOnItemSelect(sType, aArgs) {
        document.getElementById('form_id').submit();
        }
      Your message has been successfully submitted and would be delivered to recipients shortly.