Trigger click with chrome console
Asked Answered
C

0

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!

Centavo answered 21/8, 2016 at 17:47 Comment(5)
$('#ui-datepicker-div').show(); would make the calendar show upAmontillado
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?Centavo
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.Amontillado
see this stack owerflow question #6726492Harder
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')Centavo

© 2022 - 2024 — McMap. All rights reserved.