+ 2

Age calculator Problem in year

Anyone suggest me how improve year section https://code.sololearn.com/W4nB43Ojjj90/?ref=app

9th Mar 2023, 8:32 AM
Rishu
Rishu - avatar
2 Respuestas
+ 1
Delete the value in <input class="input-select" type="text" name="year" size="6" maxlength="4" value="2011"> and your problem will be fix
9th Mar 2023, 8:58 AM
Minh Lưu
Minh Lưu - avatar
+ 1
My bad for the first answer. Uh, i have a few suggestions to improve the year section of your age calculator: 1. Use a range of years: Instead of allowing the user to enter any year, consider limiting the range of years. For example, you can set the range to be the current year minus 100 years. This will ensure that the user enters a valid year and also prevent errors due to typos or mistakes. 2. Display the current year: Consider displaying the current year in a prominent place on your age calculator. This will help the user to know what year to enter easily. 3. Use a drop-down list: Instead of allowing the user to manually enter the year, consider using a drop-down list. The drop-down list can contain a range of years, making it easier for the user to select the correct year. You can use JavaScript to generate the drop-down list dynamically based on the current year and the range of years you want to allow.
9th Mar 2023, 9:41 AM
Minh Lưu
Minh Lưu - avatar