It looks like you need to add the form to your view contexts. return render_to_response ("UPSRateLookUp/upsratelookup.html",{ "form": form "results": results, "query": query }) else: form = form_upslookup() return render_to_response ("UPSRateLookUp/upsratelookup.html",{"form": form})
The thing to remember is that there's nothing special about forms when it comes to django templates, a form is simply another object that must be passed in the template context if you wish to use it. - Andrew Bobby Roberts wrote: > yeah i'm looking at that but it doesn't make sense to me..... here's a > snip > of my template, the forms.py file and the views.py file. Here are my > questions: > > 1. the form doesn't show up on the template... what am I missing here > to > get my form to show up? > > 2. how in the world do I tell the system that the form on the > template > should submit and use the process_upslookup view? > > > > -lost > > > > *template.html* (snip) > > <form method="post" action="."> > {{ form }} > <input type="submit" name="submit" value="Get > Estimate*"> > </form> > > > *forms.py* > > from django import newforms as forms > > class form_upslookup(forms.Form): > zipcode=forms.CharField(max_length=15, required=True, > help_text='Please > enter your zipcode') > > > > *views.py* > > from forms import form_upslookup > > def process_upslookup(request): > if request.method=='POST': > form = form_upslookup > query = request.POST.get('zipcode','') > if query: > results=query > else: > results="No Zipcode Entered" > return render_to_response ("UPSRateLookUp/upsratelookup.html", > { > "results": results, > "query": query > }) > else: > form = form_upslookup() > return render_to_response ("UPSRateLookUp/upsratelookup.html") --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---