Ticket #5666: newforms_prefix.diff

File newforms_prefix.diff, 802 bytes (added by anonymous, 17 years ago)
  • docs/newforms.txt

     
    860860    <li>Instrument: <input type="text" name="instrument" /></li>
    861861    <li>Haircut type: <input type="text" name="haircut_type" /></li>
    862862
     863
     864Prefixes for Forms
     865------------------
     866
     867You can put several Django Forms between one ``<form>`` tag. To give
     868each Form its own namespace you need to use the keyword argument
     869``prefix``. If you want to use several PersonForms in one HTML form::
     870
     871    >>> mother=PersonForm(prefix="mother")
     872    >>> father=PersonForm(prefix="father")
     873    >>> print father.as_ul()
     874    <li>First name: <input type="text" name="father-first_name" /></li>
     875    ...
     876
     877
    863878Fields
    864879======
    865880
Back to Top