Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

121
Views
How to click on the dropdown option from another link

This is interesting. I'm working on a Wordpress site and there are 2 dropdowns: 1- select a maker 2 - select a model

If I use the mouse to select the maker, the models are filtered according to the maker. That's working fine.

I have been requested to auto fill the dropdown with the maker, which I already did with the following code:

On the menu, I have an onclick(spage) action on the link which will call the function below. The console log is showing the right values.

function spage() {
   var valueToFind= '1';
   var option;

   var dd = document.getElementById('device_manufacturer');
      for (var i = 0; i < dd.options.length; i++) {
       if (dd.options[i].value === valueToFind) {
           dd.selectedIndex = i;
           var opt = dd.options[dd.selectedIndex];
           console.log( opt.value );
           console.log(i);
        break;
       }
     }                    
}

With this function the maker is filled, but is not filtering the second dropdown with the models.

So, the maker option needs to be clicked and not just found and display.

I'm struggling to make that work and any help will be great.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!