I am creating a website server program with Flask and Python, I am relatively new to Flask. I have created a html form with a Select tag (drop down menu, single select). You can see the code below.

**selectmenu.html**

```
<!doctype html>
<html>
<body>
    <form id="form" method="POST" class="selectform">
        <select method="GET" size=5>
            {% for x in options %}
            <option value="{{x}}" SELECTED>{{x}}</option>
            {% endfor %}
        </select>
        <input type="submit" name="go"></input>
    </form>
</body>
</html>

```

The Python code for Flask:
**app.py**

```
@app.route('/selectmenu',methods=(['GET','POST']))
def selmenu():
    optionfiles = os.listdir('options')
    form = selectform()
    if request.method == 'POST':
        selectedoption = form.selectedoption.data
        print(selectedoption)
        return redirect('/')
    return render_template('selectmenu.html',options=optionfiles,form=form)

```

And finally the Python WTForms classes code **forms.py**:

```
class selectform(FlaskForm):
    optionfiles = os.listdir('userdata')
    print(optionfiles)
    selectedoption = SelectField('selectdropdown', choices=optionfiles,validators=[DataRequired()])
    submitbutton = SubmitField('submit',validators=[DataRequired()])

```

But when the program called `form.selectoption.data` it returns `None` every time.

I have tried many tutorials, and Stackoverflow answers, but still can't get data from the form that isn't `None`.

> 
> NOTE: As you can tell I have uploaded snippets only of the code, as the actual files are all a lot larger! If you need any other bits of the code, e.g: the imports, then please ask, but I am pretty sure the error isn't the imports, for example! Otherwise I would receive an ImportError.
> 
> 
> 

Thank you in advance for your help!