-1

I am trying to create a web application in Flask, but I keep getting the error: 'Request' object has no attribute 'Name' when sending data from a 'POST' form in my html. I have two submit buttons that I have to differentiate, and I wanted to do that by using their name, which I have previously done and it worked. This is the code from my HTML:

    <input type = "submit"  class="fadeIn second" value="Add this data." name = "add">
    <input type = "submit"  class="fadeIn second" value="Delete this data." name = "delete">

and this is where i am getting the error: if request.method == 'POST' and request.Name=="add": Can anyone help me out, please?

davidism
  • 121,510
  • 29
  • 395
  • 339
bethHarmon
  • 31
  • 6

1 Answers1

0

As the error states, a Request object does not have a "Name" attribute. You can access the name value with request.form.get("add"), for example.

See here for more examples.

genbatro
  • 146
  • 8