Skip to content
Advertisement

Select Correct Value in Dropdown Box from Database with For Loop

I have a couple of dropdown boxes for Day and Year inputs. The values are taken during sign up so this dropdown is for updating purposes. I want to prepopulate the two dropdowns with the correct values that are stored in the database. The values in the dropdown are populated using a for loop and when the form is submitted the new updated value should be submitted.

Here are my two dropdowns and the PHP code to retrieve the day and year from the database:

JavaScript

Any help is appreciated!

Advertisement

Answer

You didn’t check the value with loop data learn form this code

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement