There is this dropdown menu on a website, which looks like:
<form id="birthday-form" action="#" method="get">
<select class="month">
<option value="">Month</option>
<option value="1">January</option>
<option value="2">February</option>
</select>
<select class="day">
<option value="">Day</option>
<option value="1">1</option>
<option value="2">2</option>
</select>
<select class="year">
<option value="">Year</option>
<option value="2005">2005</option>
<option value="2004">2004</option>
<option value="2003">2003</option>
</select>
</form>
Now I need to simulate a selection to this form. I use this javascript to do so:
document.getElementsByClassName('month')[0].value = '1'; document.getElementsByClassName('day')[0].value = '1'; document.getElementsByClassName('year')[0].value = '2005';
So this works in the sense that the data is entered, however, the form won't submit unless I manually click it. In other words, the form shows january, 1, 2005 selected, but acts like there was no selection. As you can see in this photo, the continue button is disabled (grayed out), but becomes enabled when a mouse click is clicked on, say, the february option.
I believe my question is similar to How to click a dropdown menu and select option?, however, it appears the original question was never answered, as nothing is approved and any code I can find does not work. So, my question: how can I select options from this form and trigger something to enable the continue button.
Thank you for the help, and please let me know if my post needs editing.