Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7671597
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T16:05:45+00:00 2026-05-31T16:05:45+00:00

I have a list menu in my php page. In this list menu i

  • 0

I have a list menu in my php page. In this list menu i have an onChange event, you can see below.

<select name="company" onChange="getproduct(this)">

The above event get product name of selected company. but now i want to change this list menu to autocomplete. I try below code but its not fetching anything, can anyone help me plz

<input type="text" name="company" id="company"  onkeyup="getproduct(this)"/>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T16:05:46+00:00Added an answer on May 31, 2026 at 4:05 pm

    Generally speaking, using the html attributes for javascript events is bad practice. Since you are using jQuery anyway, you should do something like this in an external script:

    $('#company').on('change keyup input', function() { getproduct(this); });
    

    I’ll break it down now.

    $('#company') selects the element that has an ID of “company.” This lets you work with that object with javascript by changing it or attaching event listeners.

    .on(...) attaches event listeners to the selected objects. It can be used in a few different ways, but the most basic way (which is how we are using it here), it takes two parameters, the first is a space separated list of events to listen for and the second is a callback function to execute when these events happen on the selected element.

    change is an event that is triggered when the input element has changed its value and then lost focus. This can be a useful event to use in case the user didn’t change the input by typing (possibly pasting through the context menu).

    keyup is an event that is triggered when a key is pressed and then released. See also keydown and keypress.

    input is a cool new HTML5 event that is designed to listen to user input on an element. This is important to use because it was designed specifically for what you are trying to accomplish. (Notably, the input event is triggered when the spinner arrow buttons are clicked on the number input types.) You still want to use the other events as fallbacks in case the input event isn’t supported in the user’s browser.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a SELECT LIST MENU containing products and on this menu i use
On my page I have a dropdown menu with a list of countries, this
I'm having some trouble figuring this out. I have an unordered list menu that
I have a menu list something like this: <ul class=submenuList> <li><a onclick=loadItem('Blue%20Orchid%20Press') id=Blue%20Orchid%20Press>class=on>Blue Orchid
I have a html select list menu,when user select an option he/she is redirected
I have a separate navigation php which has a list of links and menu
I have this code that generates a WP menu: <div id=menu> <?php $args =
I have this code: <div id=menu> <ul> <li><span id=menulabel>Your Languages</span></li> <?php $hotClass = '';
I have a list view filled with data. I set up a context menu
Here's my problem: I have do create a menu/list of actions (which would be

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.