Maybe you could copy the classes and id's from the template and put them in 
your form like this :

class  SomeForm(forms.Form):
    name=forms.CharField(attrs={'class':'form-control', 'id':'name'})
    message=forms.CharField(widget=forms.TextInput(attrs={'class':'the 
class name thats on the templates form for the text input'})

And then pass the SomeForm to the view as some context variable, for 
example 'form'.
In your template :
                             <form name="sentMessage" id="contactForm" 
novalidate>
                                <div class="form-group">
                                   {%for field in form%}
                                       {{field.label}} {{field}}
                                   {%endfor%}
                                <button type="submit" class="btn 
btn-xl">Send Message</button>
                             </form>

This is just advice from beginner to beginner and if there is an easier way 
please correct me! If you choose this way Kim and you don't understand 
something please ask!

On Tuesday, August 19, 2014 9:36:55 AM UTC+2, Kim wrote:
>
> Thank you for the advice, Collin! 
> However, If I have this HTML below, where should I put {{ form.[name] }}?
>
>                              <form name="sentMessage" id="contactForm" 
> novalidate>
>                                 <div class="form-group">
>                                     <input type="text" 
> class="form-control" placeholder="Your Name *" id="name" required 
> data-validation-required-message="Please enter your name.">
>                                     <p class="help-block text-danger"></p>
>                                 </div>
>                                 <button type="submit" class="btn 
> btn-xl">Send Message</button>
>                              </form>
>
> 2014年8月19日火曜日 10時42分19秒 UTC+9 Collin Anderson:
>>
>> I recommend making the same contact form in django first, then merge the 
>> two. Your starter template only makes the form look good, it doesn't 
>> provide much functionality.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c25c646e-bbc2-44c5-a4d4-fe36296c9b88%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to