Select does not update table data after selecting an option

Asked

Viewed 47 times

0

I am trying to select the field with this query however the value of select is changed but does not reload the table values, showing all. But by clicking with the mouse, it works.

document.getElementsByName("tbResult_length")[0].selectedIndex = 4

This is the page. CNAE table

1 answer

0

We need more information.

But I believe the problem lies in the event triggered at the time of the selection.

What technology are you using to crawl?

Usually when the interactions with other fields this only occurs when a certain event is triggered, I believe that is what is missing.

For example:

function simularInputEventol() {
  var input = document.getElementById('Elemento a Ser Atribuido Valor');
  var ev = new Event('change');

  input.value ='teste';
  input.dispatchEvent(ev);
}

You just have to figure out which event is needed.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.