Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

button in flask

<input type="submit" name="submit_button" value="Do Something">
<input type="submit" name="submit_button" value="Do Something Else">
def contact():
    if request.method == 'POST':
        if request.form['submit_button'] == 'Do Something':
            pass # do something
        elif request.form['submit_button'] == 'Do Something Else':
            pass # do something else
        else:
            pass # unknown
    elif request.method == 'GET':
        return render_template('contact.html', form=form)
Comment

PREVIOUS NEXT
Code Example
Python :: python get pixel color 
Python :: xaxis matplotlib 
Python :: python regex remove digits from string 
Python :: python wsgi server 
Python :: apply strip() a column in pandas 
Python :: python default input 
Python :: pd max rows set option 
Python :: how to run commands in repl.ot 
Python :: how to find shortest string in a list python 
Python :: python save input to text file 
Python :: How to find the three largest values of an array efficiently, in Python? 
Python :: python print dict new line 
Python :: drop multiple columns in python 
Python :: reset index with pandas 
Python :: delete turtle 
Python :: get cpu count in python 
Python :: python compare if 2 files are equal 
Python :: list count frequency python 
Python :: get information about dataframe 
Python :: python random choice in list 
Python :: series to dataframe with column names 
Python :: django admin image 
Python :: check if number in range 
Python :: python dataframe column string to integer python 
Python :: parquet pyspark 
Python :: logging the terminal output to a file 
Python :: how to run python code on github 
Python :: clock in python 
Python :: pandas replace null values with values from another column 
Python :: python inspect source code 
ADD CONTENT
Topic
Content
Source link
Name
9+6 =