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</...
user avatar
  • 20.7k
4 votes
Accepted

How to use inspect Element to view HTML and CSS of a website?

Thats Really simple, in Google Chrome, simply right click on the page(if your'e using a mac, its cmd-click) without selecting any text, and you shall see a menu bar, like the one in the photo below- ...
user avatar
  • 1,146
4 votes

What is markup language?

what exactly a markup language is and how it is different from programming language and scripting languages in layman's terms, a markup language is a set of markup tags. according to this: A ...
user avatar
  • 17.4k
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="...
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.
user avatar
2 votes
Accepted

How to create a drop-down menu that contains the stocks that has as options?

First, for closed tags, if you open a tag, you should close it. I see you're not closing the <select> tag. More information about that tag maybe found here. Also, you have </div> within ...
user avatar
  • 17.4k
2 votes

JS/HTML automatic reloads

I just figured it out! The reload was due to the very nature of onsubmit. When I changed it to onClick, I had no issues!
user avatar
2 votes
Accepted

Pset7 Table HTML and CSS formatting

The render() function takes two arguments, the first is a string that indicates the name of the template, and the second is an array of key-value pairs. In this case "positions" is a string that ...
user avatar
  • 1,369
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.
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.
user avatar
  • 20.7k
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>{{...
user avatar
  • 20.7k
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 ...
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 ...
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 ...
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, ...
user avatar
  • 58
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 ...
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. ...
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:...
user avatar
  • 3,035
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 ...
user avatar
  • 3,035
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 ...
user avatar
  • 3,035
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 ...
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 ...
user avatar
  • 3,035
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 ...
user avatar
  • 1,424
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() ...
user avatar
  • 3,035
1 vote
Accepted

pset7 php generated html appearing above CS50 finance header

Ignore this, It was actually fixed very easily by switching the order of the render function and the array loop. Doh!
user avatar
1 vote

hello.html ERR_ADDRESS_UNREACHABLE

well I have no idea where the problem was but I got rid of it. First, disabling/enabling adapters and adapter settings both within the application and windows really screwed up my connection, had a ...
user avatar
1 vote
Accepted

Text Edit and HTML

The latest version of TextEdit has "smart quotes" turned on by default. Notice your quotes in your screen print? They are "curly quotes" rather than straight quotes. As such, the browser doesn't ...
user avatar
  • 18.4k
1 vote
Accepted

CSS Table Gradient Not Working

I made something simple but I think you can tinker further on your own: grad.html <!DOCTYPE html> <html> <head> <link rel="stylesheet" type="text/css" href="style....
user avatar
  • 7,326
1 vote
Accepted

How to Center Footer?

Why do you have the link for the forgot password in a form group? Also you have a typo and you close the tag instead of opening it (</div class = "form-group"> <a href="forgot-password....
user avatar
  • 7,326
1 vote

How does Canvas data URL WORKS?

when your browser requests and HTML page that has an <img> element, it extracts the link of the image (the value of the src attribute of that element) and makes a new HTTP request to get that ...
user avatar
  • 17.4k

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