First, make sure the field is rendered as an input tag with type
"email". If it's not, your Django version is out of date or you're
overriding the widget somewhere.
Second, read this:
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/email#Validation
The standard pattern isn't good e
Thanks. I made it as needed and wrote simple JS to call popup if there is
an error to rise modal again after reload.
Thanks!
Dne úterý 12. září 2017 15:18:58 UTC+2 Daniel Roseman napsal(a):
>
>
> On Tuesday, 12 September 2017 14:18:29 UTC+1, Daniel Roseman wrote:
>>
>> On Tuesday, 12 September 2
I have {{ field.errors }} im my template. I changed model to not contain
blank=True, but problem is still the same.
Dne úterý 12. září 2017 15:18:58 UTC+2 Daniel Roseman napsal(a):
>
>
> On Tuesday, 12 September 2017 14:18:29 UTC+1, Daniel Roseman wrote:
>>
>> On Tuesday, 12 September 2017 08:5
On Tuesday, 12 September 2017 14:18:29 UTC+1, Daniel Roseman wrote:
>
> On Tuesday, 12 September 2017 08:52:37 UTC+1, Moreplavec wrote:
>>
>>
>>
>>> {% csrf_token %}
>>> {{ form.non_field_errors }}
>>> {% for hidden in form.hidden_fields %}
>>>
On Tuesday, 12 September 2017 08:52:37 UTC+1, Moreplavec wrote:
>
>
>
>> {% csrf_token %}
>> {{ form.non_field_errors }}
>> {% for hidden in form.hidden_fields %}
>> {{ hidden }}
>> {% endfor %}
>>
If you render the form using the typical methods ("{{ form.as_p }}" or
similar) then there should be a message over the email field with the error.
>From the code, you an use form.errors to check the errors in the form.
On Tue, Sep 12, 2017 at 8:10 AM, Moreplavec
wrote:
> I understand, but why
I understand, but why while using model form it's not cought by form itself
same as missing or incorect field like "asdf" for email? This is my
problem. I need to show error and not to try to save :)
Dne úterý 12. září 2017 12:47:16 UTC+2 Vijay Khemlani napsal(a):
>
> "asdf@asdf" is not a vali
"asdf@asdf" is not a valid email so form.is_valid returns False and
form.save is never called
On Tue, Sep 12, 2017 at 4:52 AM, Moreplavec
wrote:
> Greetings,
>
> i have strange problem with my model form. I have simple form for taking
> orders, model looks like:
>
> class Order(models.Model):
8 matches
Mail list logo