Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to separate data from two forms in django

<form method="post" id="formOne">
    {% csrf_token %}
   <input type="hidden" name="form_type" value="formOne">

    .....
</form>

.....

<form method="post" id="formTwo">
    {% csrf_token %}
    <input type="hidden" name="form_type" value="formTwo">
   ....
</form>
Comment

how to separate data from two forms in django

def handlemultipleforms(request, template="handle/multiple_forms.html"):
    """
    Handle Multiple <form></form> elements
    """
    if request.method == 'POST':
        if request.POST.get("form_type") == 'formOne':
            #Handle Elements from first Form
        elif request.POST.get("form_type") == 'formTwo':
            #Handle Elements from second Form
Comment

PREVIOUS NEXT
Code Example
Python :: python override inherited method data model constructor 
Python :: # remove sensitive information like name, email, phone no from text 
Python :: enumerate and looping backward 
Python :: fibo_itrativ 
Python :: adjoint of 3x3 matrix in numpy 
Python :: penggunaan len di python 
Python :: Use PIP from inside script 
Python :: Python range Incrementing with the range using a positive step 
Python :: raspberry pi set python 3 as default 
Python :: Visual Studio Code pylint: Error when all is ok 
Python :: Python script to download all images from a website to a specified folder with BeautifulSoup 
Python :: python how to convert each word of each row to numeric value of a dataframe 
Python :: python turtle star 
Python :: map function in pyhton 
Python :: phlib examples python 
Python :: DOWNLOAD ANALYZE_DXP.PY 
Python :: how to map url with usernames prefixed 
Python :: how to blend pixels in pygame 
Python :: for y in range(10): for x in range(y): print("*",end=') print() 
Python :: converter json em form-data-encoded python 
Python :: DELETE c1 FROM tablename c1 INNER JOIN tablename c2 WHERE c1.id c2.id AND c1.unique_field = c2.unique_field; 
Python :: python run unix command 
Python :: view scrapy response in chrome from inside the spider 
Python :: django recapcha 
Python :: We want to estimate the cost of painting a property. Interior wall painting cost is Rs.18 per sq.ft. and exterior wall painting cost is Rs.12 per sq.ft. 
Python :: python save base64 temp file 
Python :: python class overwrite length method 
Python :: arrays with name instead of index python 
Python :: find max, min character 
Python :: python time-stamp conversion 
ADD CONTENT
Topic
Content
Source link
Name
9+1 =