Hot answers tagged

7 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</...
  • 20.8k
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 ...
  • 17.6k
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="...
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.
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 ...
  • 1,389
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

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.
  • 20.8k
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>{{...
  • 20.8k
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 ...
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 ...
  • 302
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/...
  • 18.5k
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.
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 ...
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 ...
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, ...
  • 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 ...
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:...
  • 3,046
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 ...
  • 3,046
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 ...
  • 3,046
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 ...
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 ...
  • 3,046
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 ...
  • 1,412
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 ...
  • 17.6k
1 vote

What is markup language?

HTML codes don't need to be compiled to work. Here is a useful link: http://www.yourhtmlsource.com/starthere/whatishtml.html
  • 100
1 vote

img tag - src attribute

The src attribute of the <img> tag takes a URL of an image. I don't think it is the case that when you put a URL of a JS file as a value for any attribute named src, the code in the file gets ...
  • 17.6k
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() ...
  • 3,046
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!
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 ...

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