Create a select box for year, month and number of days in a month

I want to create a custom doctype where I can select the current year and based on that I should get the month dropdown and once I’ll select the month then I can see the number of days in that month.