This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
Hello,
I am working on the application.py sell function and I am trying to allow a user to choose a stock and amount of shares to sell by displaying a table like the one in index.html that uses a radio button and drop down list for the user to choose what they want to sell like this. I am trying to pass the value chosen from the drop down list to my application, but when I test it by passing the values the user POSTed on a test.html page by using "request.form.get("shares_to_sell")" I get "None" for the drop down list value. Does anyone know how to properly get the value chosen from the drop down list so I can use it in application.py? Here is my html code for the option values below:
{% for i in range(stock["shares"] 1) %}
<option name="shares_to_sell" value="{{ i }}">{{ i }}</option>
{% endfor %}
Subreddit
Post Details
- Posted
- 7 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/cs50/commen...