Stanislav,

Look at how you defined the fields of your Form class.

You probably defined the phone field as something like:

phone = forms.CharField(
    required   = True,
    max_length = 50,
    label      = u'Phone',
)

Change it to:

phone = forms.CharField(
    required   = True,
    max_length = 50,
    label      = u'',
    widget = forms.TextInput(
attrs={
            'class'       : 'form-control',
            'id'          : 'inputSuccess5',
            'placeholder' : 'Phone',
        }
),
)

--Fred
------------------------------------------------------------------------
Fred Stluka -- mailto:[email protected] -- http://bristle.com/~fred/
Bristle Software, Inc -- http://bristle.com -- Glad to be of service!
Open Source: Without walls and fences, we need no Windows or Gates.
------------------------------------------------------------------------
On 3/18/16 10:53 AM, Stanislav Vasko wrote:
Hello,

as a noob in Django, i will ask noob question about Forms, because i cant find.

I have working app, based on Bootstrap with theme and custom css. Rather than Django admin i want to create/edit data from my fields. I tried to use Django forms, but no luck. It looks... bad :) Its simple, but i have no controll over the result:

    {% for field in form %}
        <div class="fieldWrapper">
            {{ field.errors }}
            {{ field.label_tag }} {{ field }}
            {% if field.help_text %}
            <p class="help">{{ field.help_text|safe }}</p>
            {% endif %}
        </div>
    {% endfor %}


Insted of simple form i found form.as_p(), form.as_ul() aso, but it doesnt solve my problem too, just gives me little changed result. I need to be able insert and read data from my own tem plate, like:

    <div class="col-md-6 col-sm-6 col-xs-12 form-group has-feedback">
        <input class="form-control" id="inputSuccess5"
    placeholder="Phone" type="text">
        <span class="fa fa-phone form-control-feedback right"
    aria-hidden="true"></span>
    </div>


Please, can you help me how to get clean data and after update put them back? Thanks for any tips or direct link.
--
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 [email protected] <mailto:[email protected]>. To post to this group, send email to [email protected] <mailto:[email protected]>.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/541fd731-d2b9-4fbd-807a-420ba5d21d3e%40googlegroups.com <https://groups.google.com/d/msgid/django-users/541fd731-d2b9-4fbd-807a-420ba5d21d3e%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.

--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/56EC2CA2.2090001%40bristle.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to