It does what it is coded to do, but you coded it to do something you don’t want. It happens more often than you think. There is no error.
What it does is have two ways to create a record in your database. One way is to change the gender drop down. That puts a record into the database with the value male, female, or Please choose one. Foodtype will be undefined.
The second way is to push the Next button. That creates a record in your database with foodtype set to whatever is in txtinput. Gender will be undefined.
I suspect what you wanted is to have only one way to create a record with both gender and foodtype set. The way you would do that is to remove the onEvent from dropdown2. Change the onEvent for the button to test if there is a valid value in dropdown2, meaning not Please choose one. You could also check to see if txtinput is not blank. If so then create a record with both the dropdown2 and the txtinput values else don’t and possibly make a text box visible that says either gender or favorite food is blank.