I was able to create a select list using bootstrap for my 'sell.html':
<div class="form-group">
<select class="form-control","input-group" id="sel1" autocomplete="off" autofocus name="symbol" type="text"/>
<option disabled="" selected="" value="">Symbol</option>
{% for i in symbol %}
<option value="{{ i.Symbol }}">{{ i.Symbol }}</option>
{% endfor %}
</select>
</div>
The problem is am not able to pass it to @app.route of sell...
# else if user reached route via GET (as by clicking a link or via redirect)
b_symbol=db.execute("SELECT Symbol FROM portfolio")
return render_template("sell.html",symbol=b_symbol)
@app.route("/sell", methods=["GET", "POST"])
@login_required
def sell():
"""Sell shares of stock."""
.
.
.
.
#ensure user symbol was submitted
if not request.args.get('symbol'):
return apology("Enter symbol")
even when i use:
if not request.args.getlist('symbol'):
return apology("Enter symbol")
i get the same result in either cases..."Enter symbol" Please help me find my mistake.Thank you