7

I'm trying to trigger the click event on the Valid for and the Begin form fields in this Angular page using Chrome Console, I tried Javascript and jQuery using .click() or .trigger('click') with no luck so far. I'd expect when one of these fields is clicked the relevant dropdown would appear like it would if you manually click it using the mouse. Could someone help please?

https://www.eex-transparency.com/homepage/power/germany/production/usage/actual-unitwise-production-100-mw-

Thanks!

Maddy
  • 71
  • 1
  • 2
  • 1
    `$('#ui-datepicker-div').show();` would make the calendar show up – RST Aug 21 '16 at 18:50
  • Thanks! Still need to know how to make the time dropdown appear as well. Also, I'm curious to know why doesn't triggering a click on the input field behave like a normal user and make the dropdown appear. Is the click not occurring at all? – Maddy Aug 21 '16 at 19:26
  • Did you try anything to make the time dropdown show up in a similar way? The click event not happening could be due to it being disabled in your script. Maybe it is reacting to focus() instead of click() for instance. – RST Aug 22 '16 at 07:37
  • see this stack owerflow question http://stackoverflow.com/questions/6725992/chrome-developer-console-question – Morteza QorbanAlizade Aug 22 '16 at 07:58
  • 1
    Thanks guys! Now it makes sense to me, I always thought that I need to trigger the click event, but apparently the date was triggered by focus, and the time triggered by mousedown! So I got it to display the dropdowns by: `$('#from').focus()` and `$('#s2id_time_spans > a').trigger('mousedown')` – Maddy Aug 22 '16 at 14:26

0 Answers0