Hi all

I'm having problems trying to understand how to customise an element in a form.
Im using a TextField and I want the TextArea element to be much bigger in size.
 From reading I gather one uses widgets. I found this page but it's quite 
different 
from the code in my model or view. http://www.djangosnippets.org/snippets/35/

I'm wanting something like <textarea name=="details" cols=60 rows=70></textarea>
The code below is a minimal example that displays something like this
               +------------+
               |            |
Lots of text: +------------+

The textarea is about two lines high only. I want the text entry box to be much 
bigger as it will be holding a full page of text including HTML tags.

MODELS

from django.db import models

class Contact(models.Model):
     name  = models.CharField(maxlength=500)
     phone = models.CharField(maxlength=200)
     details = models.TextField()

VIEWS

from contacts_tutorial.contacts.models import Contact
from django import newforms as forms
from django.shortcuts import render_to_response

def test(request):

     ContactForm = forms.form_for_model(Contact)
     form = ContactForm()

     data = { 'request': request,
              'form': form,
     }

     return render_to_response('test.html', data)

TEMPLATE

<form action='{{ request.path }}' method='POST'>
Lots of text: {{ form.details }}
<input type=submit name='submit' value='Submit'>
</form>


-- 
Michael Lake




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to