Hot answers tagged

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</...
Blauelf's user avatar
  • 20.9k
3 votes

How to link submit button with the <select> list in HTML?

You can achieve that using JavaScript: <div> <h1>SELECT A TOPIC</h1> <select id="select"> <option value="physics">physics</option> <option value="...
Michał Perłakowski's user avatar
3 votes
Accepted

CSS Having No Affect in PSET7

shift-reload or ctrl-F5 will clear the browser's cache and (should) reload your css file.
DinoCoderSaurus's user avatar
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.
DinoCoderSaurus's user avatar
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 ...
Matt Friend's user avatar
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.
Blauelf's user avatar
  • 20.9k
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>{{...
Blauelf's user avatar
  • 20.9k
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 ...
curiouskiwi's user avatar
  • 18.6k
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&...
Ysoni18's user avatar
  • 47
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 ...
MARS's user avatar
  • 5,169
1 vote

cant find preview option for html files on cs50 ide

you got to go to prefs>user settings>ide behavior>enable preview
aflamaroc's user avatar
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"
curiouskiwi's user avatar
  • 18.6k
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 ...
MARS's user avatar
  • 5,169
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 ...
SozDaneron's user avatar
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 ...
Steve Bunting's user avatar
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. ...
DinoCoderSaurus's user avatar
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:...
hotwebmatter's user avatar
  • 3,050
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 ...
DinoCoderSaurus's user avatar
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 ...
sk.76's user avatar
  • 312
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/...
curiouskiwi's user avatar
  • 18.6k
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.
DinoCoderSaurus's user avatar
1 vote
Accepted

Jinja - for loop

the share in for share in sharesOwnedis the object itself so when u try to use something like priceNow[share] , it doesnt make sense. if you have a diff pricenow list then u can iterate both list ...
Vikrant Pradhan's user avatar
1 vote
Accepted

Pset7, Index, why does it not show other stocks i own?

This sql "SELECT symbol, price, name, SUM(shares) AS quanties FROM shares WHERE id=:id" always returns one row. Try it in sqlite3/phpliteadmin. You need a GROUP BY clause . Since you (presumably) want ...
DinoCoderSaurus's user avatar
1 vote

HTML form is not displaying in pset7

It's going straight to the 'else' option because when the page initally loads, it's not actually a 'POST' request. It's a 'GET' request. With GET you are retrieving the .hmtl file to be loaded. So, ...
Matt's user avatar
  • 58
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 ...
hotwebmatter's user avatar
  • 3,050
1 vote
Accepted

Do calls to render() overwrite each other?

When you call render() in a controller, the function is only executed once and then it exits. No other code in the PHP Controller will execute after the call to render(), so it is not possible for ...
hotwebmatter's user avatar
  • 3,050
1 vote
Accepted

pset6: requesting php from within html isn't working

Since those are the only two tests that fail check50, redirect your attention to how query is built in parse. Since hello.php "works fine", verify that query is properly null-terminated. A helpful ...
DinoCoderSaurus's user avatar
1 vote
Accepted

Encrypted passwords in POST method

Q: When should I encrypt passwords? A: Always, and as soon as possible. Whenever a user enters sensitive information like a password, you should immediately encrypt it using a one-way hash function ...
hotwebmatter's user avatar
  • 3,050
1 vote
Accepted

Pset7 finance html login_form.php

Consult this section of the pset specs: http://cdn.cs50.net/2015/fall/psets/7/pset7/pset7.html#styles There are two .css files contained within the pset7/public/css directory that you are free to ...
Peter's user avatar
  • 1,412
1 vote

pset7 How to implant HTML

Rather than reading a mountain of documentation online, just take a closer look at the distribution code provided by CS50 Staff in the pset7.zip archive. Make sure that you understand the render() ...
hotwebmatter's user avatar
  • 3,050

Only top scored, non community-wiki answers of a minimum length are eligible