FLASK - Updating Form without updating certain fields causes 400 Bad Request Error

I created a <form> that updates the values in an HTML <table>, however for my form fields that are drop-downs, if I don't update them before clicking the submit button, they throw this error:

werkzeug.exceptions.BadRequestKeyError: 400 Bad Request: 
The browser (or proxy) sent a request that this server could not understand. 
KeyError: 'eligible_applicant_category'

In other words, if I change the selection in the drop-down fields, it updates successfully, however if I leave the selection as is, it throws the above error.

Narrowed code to only show the drop-down fields causing the error:

Class View:

class FundingSource(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    eligible_applicant_category = db.Column(db.Text(), nullable=True)
    eligible_cost = db.Column(db.Text(), nullable=True)
    status = db.Column(db.String(100), nullable=True) 
    notes = db.Column(db.Text(), nullable=True)

Flask View:

@main.route("/eligibleCostMaster", methods=['GET'])
def elig_cost():
        all_data = FundingSource.query.all()
        return render_template('eligibleCostMaster.html', title='Eligible Cost Master', fsources=all_data)

@main.route("/updateElig", methods=['GET', 'POST'])
def updateElig():
    if request.method == 'POST':
        my_data = FundingSource.query.get(request.form.get('id'))

        my_data.eligible_applicant_category = request.form['eligible_applicant_category']
        my_data.eligible_cost = request.form['eligible_cost']
        my_data.status = request.form['status']
        my_data.notes = request.form['notes']

        db.session.commit()
        flash("Eligible Cost Updated Successfully")

        return redirect(url_for('main.elig_cost'))

Template (form) View: (Only showing code for one of the drop-down form fields)

<form action="{{url_for('main.updateElig')}}" method="POST">
     <div class="form-group">
        <label>Eligible Applicant Category:</label>
        <select name="eligible_applicant_category" class="form-control">
            <option name="eligible_applicant_category" disabled hidden selected value="{{row.eligible_applicant_category}}" SELECTED>{{row.eligible_applicant_category}}</option>
            <option value="Federal Department/Agency">Federal Department/Agency</option>
            <option value="Local Department/Agency">Local Department/Agency</option>
            <option value="Locality">Locality</option>
            <option value="Metropolitan City">Metropolitan City</option>
            <option value="State">State</option>
            <option value="State Department/Agency">State Department/Agency</option>
            <option value="Transportation Entity">Transportation Entity</option>
            <option value="Tribe">Tribe</option>
        </select>
     </div>

Please let me know if my question is confusing, I am relatively new to all of this. TIA!!

EDIT:

Fixed the problem!! I just had to change "disabled hidden selected" in the tag to "hidden"


werkzeug.exceptions.BadRequestKeyError: 400 Bad Request: 
The browser (or proxy) sent a request that this server could not understand. 
KeyError: 'eligible_applicant_category'

It means that you are trying to access parameters not present in the http request. Try printing the contents of the request.form object and check that the fields you are trying to access (eligible_cost, status, etc..) are actually present.

You can also avoid this exception by checking that the http request parameter you want to access exists:

if 'name_of_filed' in request.form:
    my_field = request.form['name_of_filed']

Another possible solution to avoid the exception would be to use the get method of the form property.

my_field = request.form.get('name_of_filed', 'default_value')

The default value ('default_value') can be omitted, in which case the get function will return the value None if the field is not present