Esempio n. 1
0
 def form_name_view(request):
     form=forms.FormName()
     if request.method == 'POST':
         form = forms.FormName(request.POST)
         if form.is_valid():
             #do something LANGUAGE_CODE
             print("validations success!")
             print("NAME:"+form.cleaned_data['name'])
             print("Email:"+form.cleaned_data['email'])
             print("Text:"+form.cleaned_data['text'])
     return render(request,'basicapp/form_page.html',{'form':form})
Esempio n. 2
0
 def form_name_view(request):
 form = forms.FormName()#create object for FromName class from forms.py
 if request.method == 'POST':#enters when submit is pressed
     form = forms.FormName(request.POST)
     if form.is_valid():
         print("validation success")
         print(form.cleaned_data['name'])#prints the submitted info in the form
         print(form.cleaned_data['email'])
         print(form.cleaned_data['text'])
 form_dict = {'form':form}
 return render(request,'form_app/form_page.html',form_dict)
Esempio n. 3
0
def form_name_view(request):
    form = forms.FormName()

    if request.method == 'POST':
        form = forms.FormName(request.POST)

        if form.is_valid():
            print("Validation Success!")
            print("Name: " + form.cleaned_data['name'])
            print("Email: " + form.cleaned_data['email'])
            print("Text: " + form.cleaned_data['text'])

    return render(request, 'first_app/forms.html', {'form': form})
Esempio n. 4
0
def form_name_view(request):
    form = forms.FormName()

    if request.method == 'POST':
        form = forms.FormName(request.POST)

        if form.is_valid():
            #DO SOMETHING CODE!!
            print("Validation Sucess!")
            print("NAME" + form.cleaned_data['name']) # this comes from forms.py
            print("EMAIL" + form.cleaned_data['email']) # this comes from forms.py
            print("TEXT" + form.cleaned_data['text']) # this comes from forms.py

    return render(request,'basicapp/form_page.html',{'form':form})
Esempio n. 5
0
def formView(request):
    form = forms.FormName()
    # .FormName() -> this is the form you made in the forms.py
    
    # do something with the data
    if request.method == 'POST':
        form = forms.FormName(request.POST)
        
        if form.is_valid():
            # do some code
            print('VALIDATION SUCCESS')
            # key must be the attribute of form model you created
            name = form.cleaned_data['name']
            email = form.cleaned_data['email']
            text = form.cleaned_data['text']
        
    form_dict = {
        'form': form
    }
    return render(request, 'app_2/forms.html', form_dict)
Esempio n. 6
0
 def form_name_view(request):
     form=forms.FormName()
     return render(request,'basicapp/form_page.html',{'form':form})
Esempio n. 7
0
def form_name_view(request):
    form = forms.FormName()
    return render(request, "form_name.html", {"form": form})