Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Usability: stripping white space from form fields
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Greg Fuller  
View profile  
 More options Jul 4 2008, 3:51 am
From: Greg Fuller <gregf...@gmail.com>
Date: Fri, 4 Jul 2008 00:51:10 -0700 (PDT)
Local: Fri, Jul 4 2008 3:51 am
Subject: Usability: stripping white space from form fields
I want to mention what I consider to be a usability issue with Django
forms.  It has to do with there being no option to strip  leading and
trailing whitespace from CharFields, URLFields, EmailFields, etc.
Ticket #4969 was to address this issue but was closed with as a
'wontfix', and I have seen other discussions on this issue.

As a developer, I know better than to enter spaces in a field, or to
blank an existing  entry with spaces.  But non-technical users more
often than not do not make this distinction.  Here are some
implications of not stripping these fields:

1. It let's the user get past required=True. You can set this behavior
if you go to to admin-->sites, edit the display name by blanking it
out with spaces, and save.  The "this field is required" message is
not displayed and the record is saved.  Of course technically the
field is not empty, but for all practical purposes it is.

2. An example of an even more serious problem is what happens if you
blank out the domain name field of a site with spaces.  Then you
cannot even select the site from the list  to edit it.  There is no
way to correct the error through normal procedures.

3.  In another situation, it  causes confusion on field errors.
Consider an email field that is not required, but must be valid if it
is entered.  If the user enters an email address, then blanks it out
with spaces, or just leaves one space before saving , he or she will
get an error message to enter a valid email.  This is very confusing,
not to developers of course, but to others.  They see an error message
to enter a valid email on a field that is not required, and the field
appears to be blank.

4. It also results in unwanted leading and trailing spaces.  In most
use cases, you don't want leading or trailing spaces in a char field
and URL field, an email field, etc.

I know this has been discussed before, but I hope this ticket can be
reopened,  and that stripping white space can at  least be an option.
I'm sure there are use cases where leading and trailing white space is
significant, but  in most use cases,  not stripping white space causes
usability issues that I  feel compelled to address one way or another.

This is not just theoretical - I have seen  parallel  problems in past
applications during usability testing and with customer support.

Thanks for considering this, and thanks for a great framework !


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Karen Tracey  
View profile  
 More options Jul 4 2008, 9:42 am
From: "Karen Tracey" <kmtra...@gmail.com>
Date: Fri, 4 Jul 2008 09:42:03 -0400
Local: Fri, Jul 4 2008 9:42 am
Subject: Re: Usability: stripping white space from form fields

On Fri, Jul 4, 2008 at 3:51 AM, Greg Fuller <gregf...@gmail.com> wrote:
> I want to mention what I consider to be a usability issue with Django
> forms.  It has to do with there being no option to strip  leading and
> trailing whitespace from CharFields, URLFields, EmailFields, etc.
> Ticket #4969 was to address this issue but was closed with as a
> 'wontfix', and I have seen other discussions on this issue.

I think you mean #4960 (http://code.djangoproject.com/ticket/4960), not
#4969.  There is also another ticket opened for this, #6362 (
http://code.djangoproject.com/ticket/6362) which is in design decision
needed.

I agree that an option to strip leading/trailing wihtespace from form fields
would be useful, and is probably more often than not the behavior that is
desired by default.

Karen


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Norman Harman  
View profile  
 More options Jul 7 2008, 10:33 am
From: "Norman Harman" <nhar...@statesman.com>
Date: Mon, 07 Jul 2008 09:33:53 -0500
Local: Mon, Jul 7 2008 10:33 am
Subject: Re: Usability: stripping white space from form fields

It's easier and quicker to locally extend Django.

Here's the start of my forms extension.  It has all the form goodness I
want and in my forms.py I do a

from myforms import *

from django import newforms as forms
from django.newforms import ModelForm
from django.newforms.models import ModelChoiceField,
ModelMultipleChoiceField
from django.contrib.localflavor.us.forms import USPhoneNumberField
from django.newforms.fields import *
from django.newforms.widgets import *
import django.newforms.fields
import django.newforms.widgets
__all__ = ["StrippedCharField",]
__all__.extend(["forms", "ModelForm", "ModelChoiceField",
"ModelMultipleChoiceField", "USPhoneNumberField"])
__all__.extend(django.newforms.fields.__all__)
__all__.extend(django.newforms.widgets.__all__)

class StrippedCharField(CharField):
     """Newforms CharField that strips trailing and leading spaces."""
     def clean(self, value):
         if value is not None:
             value = value.strip()
         return super(StrippedCharField, self).clean(value)

--
Norman J. Harman Jr.
Senior Web Specialist, Austin American-Statesman
___________________________________________________________________________
You've got fun!  Check out Austin360.com for all the entertainment
info you need to live it up in the big city!


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google