6
votes
Accepted
How to get a value using flask, from a selected option in a drop down list?
Give your select a name, and your options a value each.
<select class="form-control" id="rating" name="rating">
<option value="5">5</option>
<option value="4">4</...
2
votes
Accepted
How do I cluster markers on a googlemap?
Thanks to @DinoCoderSaurus for your help - basically the problem was that I was trying to instantiate a MarkerClusterer for each individual marker that was added to the array. The solution was to ...
2
votes
Accepted
HTML form is not displaying in pset7
Flask is doing what you told it to do. There is a line to return an apology. Instead, do something like
return render_template("addcash.html")
or whatever your template's name is.
2
votes
Accepted
Why "rowspan" is not working in my code
You have more <tr> than </tr>, and the rowspan elements probably should be in the first row.
Maybe you can try something like
{% for stock in symbol %}
<tr>
<td>{{...
2
votes
Accepted
Access just the text from a db.execute return
Much like you would have seen in the CS50 Finance, db.execute returns a list of dict objects. So just as you accessed the cash value for your index page using rows[0]['cash'] you need to access your ...
2
votes
Accepted
How To Make A Google "I'm Feeling Lucky" Button For CS50 Project 0
To make an I'm feeling lucky button, use this code
<input value="I'm Feeling Lucky" aria-label="I'm Feeling Lucky" id="lucky" name="btnI" type="submit&...
2
votes
Accepted
403 Forbidden - When Trying To Access HTML
That is the mode required to access a file with apache50 server. You will need to chmod 644 the html file, or any file, to get rid of the "403 Forbidden" error.
2
votes
Accepted
How to iterate over a list of values in a dict using jinja?
It's not jinja syntax, it's python syntax. for movie in movies: iterates over the members (keys) of movies, thus movie is a string.
Contemplate how creating movies as a list of dictionaries, one ...
2
votes
Accepted
Problem with Updated CS50 Finance - all API calls to lookup stocks come back as None
Solved it! By comparing old and new distribution code, I found that my requirements.txt file was missing the line:
pytz
Adding that in fixed everything.
1
vote
Accepted
Relative linking
@CliffB nailed it in the comments. If your css directory is located in the parent directory of my-page, the correct way to use a relative path would be to prepend ../ before your path.
This could be ...
1
vote
How to get markdown info to HTML
A possible method has been mentioned in the Hints part.
By default, when substituting a value in a Django template, Django HTML-escapes the value to avoid outputting unintended HTML. If you want to ...
1
vote
Accepted
CS50 Final Project Jinja For Loop Not Running
It's running but nothing "matches" (ie is true) because of the date formats. Assuming "due_date" is TEXT in the db with the format "YYYY-MM-DD", current_date needs to be ...
1
vote
Accepted
CS50 Final Project / Personalized HTML path
The path should be:
@app.route("/entry/<title>", methods=["GET"])
@login_required
def entry(title):
return render_template("entry.html", title=title)
This will ...
1
vote
Accepted
Problem Set 8 / Finance. How to incorporate current price (index)
This prices = lookup(stock['symbol']) holds the values from the last symbol in the stocks list. This "put the current prices into a new list/dict and somehow adding it to the stocks." is on ...
1
vote
Finance Portfolio (index) I can't go on. Need to take to HTML the actual price and total of stock
Suggest you add the desired fields to the portfolio dicts. In the for row in portfolio: loop, something like row['name'] = share['name'] for example. When portfolio is sent to the html, each row will ...
1
vote
Accepted
Why the <p> need not be closed?
You can't put a non-inline content (like a form) inside of a paragraph tag.
1
vote
Accepted
Final project (very similar to Finance) : How can I delete selected row of table?
You can add "name" and "value" attributes to each button element (reference: MDN doc). You wouldn't need the hidden input elements.
1
vote
Accepted
html and CSS link do not work Homepage Problem
The problem is because of the trailing slash (/) in the href attributes, for example href="a.html/". There are two places you can see feedback that will describe what it is doing. One is the address ...
1
vote
Accepted
Does CS50 IDE run SSI?
SSI is not standard, so if the code does not work, the server may not support it, or the syntax is not adequate. It is not possible what you intend only with HTML or CSS, it is necessary to use some ...
1
vote
cant find preview option for html files on cs50 ide
you got to go to prefs>user settings>ide behavior>enable preview
1
vote
Why my css file is not being implemented in my html file?
<link rel="spreadsheet" href="style.css">
The rel should be "stylesheet" not "spreadsheet"
1
vote
Why can I not open my website in HTML?
"open index.html" is not the appropriate command to open the browser, if we are in the appropriate directory, this command will open a file like this name in the IDE editor, if the file does not exist ...
1
vote
Accepted
Final project SQL Error: execute() takes 2 positional arguments but 3 were given
Turns out I had to us the semicolon. The below works.
row_1 = db.execute("SELECT bum FROM conversion WHERE unit = :id", id =
request.form.get("unit_1"))
row_2 = db.execute("SELECT bum FROM ...
1
vote
Accepted
I am accessing value from SQLite data base and multiplying it in html it is showing an error kindly help
The problem is that you are trying to access the list currentprices in quoted.html using a dictionary as the index. You are trying to return the value of the following list element, which obviously ...
1
vote
Accepted
Take input as number from a html input field
VALUES is a reserved word in mysql (full list here); used only in INSERT syntax.
CS50::query replaces all '?' with the values sent as arguments. Let's assume id is 1, symbol is X and shares is 20. ...
1
vote
403 Forbidden - When Trying To Access HTML
@DinoCoderSaurus is right.
See also 403 Forbidden / permissions / chmod -- the definitive guide on the CS50 Reddit, for details on the minimum required permissions for different types of file.
TL;DR:...
1
vote
Accepted
pset7-getting one value from database into htmk
The output looks like a list of dictionary objects, and in fact it is. From the Hints section of the spec:
If str is a SELECT, then execute returns a list of zero or more dict objects, inside of ...
1
vote
Accepted
Final Project help with centering html table
You are using Bootstrap to stylize ur table and as I see u r using <table class="table table-striped"> to create stripped table but r u really getting a stripped table? Change ur code to ...
1
vote
Accepted
what is a node and what is an element in HTML?
Basically, everything is a Node. And <title> foo </title> is an element.
Read more here:
https://www.w3schools.com/html/html_elements.asp
and
https://www.w3schools.com/jsref/...
1
vote
Accepted
Why do I get a wrong html file after executing a quote function? pset finance
Look at the tab when you are entering the stock symbol. Does it say "Register"? Looks like quote.html started with the register.html code. It's still calling the register route on submit.
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
html × 116pset7 × 28
javascript × 21
python × 20
finance × 18
final-project × 18
css × 15
flask × 14
php × 10
cs50x × 9
pset8 × 7
sql × 6
jinja × 6
index.html × 5
jinja2 × 5
homepage × 4
pset6 × 3
cs50-web-programming-with-python × 3
index × 3
pset9 × 3
cs50w × 3
web × 3
table × 3
button × 3
c × 2