auto correcting on the client

J

jamthoyoung

Hi

I have noticed a several plugings (jquery mask and the dojo date
widget) auto correct user data if it is entered improperly. Or they
delete the data when the user tabs out of the input.

Is this normal behaviour for apps heavy with javascript?

It seems dangerous. A defect was opened in one of my apps (validation
on the server side) due to this behaviour. The user would enter bad
data in an optional input, click submit - then no error. They would
not even know they did anything wrong, because the input deleted
itself before submitting.

Just wondering how this is usually handled.

Thanks
 
E

Evertjan.

wrote on 07 feb 2008 in comp.lang.javascript:
I have noticed a several plugings (jquery mask and the dojo date
widget) auto correct user data if it is entered improperly. Or they
delete the data when the user tabs out of the input.

How would we know?
You could look inside.
Is this normal behaviour for apps heavy with javascript?

Define "apps heavy with javascript".

Are you perchance talking about Java?
It seems dangerous. A defect was opened in one of my apps (validation
on the server side) due to this behaviour.

How does one open a "defect"?
The user would enter bad
data in an optional input,

How can an said:
click submit - then no error. They would
not even know they did anything wrong, because the input deleted
itself before submitting.

Perhaps the value/content of the said:
Just wondering how this is usually handled.

Programmatically?
 
J

jamthoyoung

 wrote on 07 feb 2008 in comp.lang.javascript:


How would we know?
You could look inside.
Sorry but it's not a question, but a statement (at least as far as the
mask is concerned). A jquery mask I am using auto-corrects the data.
I didn't mean for you to investigate.
Define "apps heavy with javascript".
Hmmm - my badly worded question. I think I will reply separately with
a separate question for what I really want to ask.
Are you perchance talking about Java?
On the server side yes, but js on the client side. But not important I
think.
How does one open a "defect"?
It's an internal test logging tool we use. I guess not important as
far as my question.
How can an <input> be optional?
The user is allowed to enter information if they want, but it is ok if
omitted. I have a <form> that allows the user to enter a phone
number. If they provide none, that is ok. But if they do enter the
phone then it must be in acceptable format, say (999)999-9999. I am
using a jquery mask to enforce this, in addition to server-side
validation(yes java).
Perhaps the value/content of the <input> did?
The <input> had wrong content, the js mask attached to the <input>
deleted the content when the input lost focus. This is how the js mask
is designed.
 
J

jamthoyoung

To clarify what I'm asking:

When js libraries (like some of the jquery plugins) are attached to an
<input>, is it normal to auto-correct the user onblur?
 
J

Joost Diepenmaat

To clarify what I'm asking:

When js libraries (like some of the jquery plugins) are attached to an
<input>, is it normal to auto-correct the user onblur?

Depends. Some slight cleanup may be useful (for instance, removing
unneeded whitespace), but as you point out when taken to extremes it can
lead to unintuitive behaviour.

If it doesn't do what you think it should do, don't do it.

Joost.
 
R

RobG

Hi

I have noticed a several plugings (jquery mask and the dojo date
widget) auto correct user data if it is entered improperly. Or they
delete the data when the user tabs out of the input.

Is this normal behaviour for apps heavy with javascript?

It seems dangerous.

Behaviour like auto-correcting should be a user preference - I hate it
so you can tell what my opinion will be about that. :)

A defect was opened in one of my apps (validation
on the server side) due to this behaviour. The user would enter bad
data in an optional input, click submit - then no error. They would
not even know they did anything wrong, because the input deleted
itself before submitting.

That sounds like not only bad behaviour, but poor client-side
validation. It doesn't make sense to "auto-correct" to an invalid
value.

Just wondering how this is usually handled.

In large or complex applications, the client-side validation usually
does things like type, formatting, string length, etc. and can be
based on a value in the class attribute, e.g.:

<input type="text" class="mandatory val_date" ...>

Of course the user should be given a hint that they should enter a
date and the format required.

Business rule validation is usually done on the server. Many business
rule validation issues can be attenuated if users are presented with
lists that only contain valid values (or values that are very likely
to be valid) - how you get the list is another design issue that
needs careful consideration.
 
L

Lasse Reichstein Nielsen

To clarify what I'm asking:

When js libraries (like some of the jquery plugins) are attached to an
<input>, is it normal to auto-correct the user onblur?

I don't know what "normal" is, but it's definitly not desirable in many
cases.

If someone enters a useful entry, formatting it to a canonical format
is nice, but won't change the effect of submitting the value. I.e., if
Javascript is disabled, the submitted value is equivalent anyway.

It is never acceptable to delete a malformed input. The user might have
made a typo, one that is easily fixed, but if the input is removed, he
will have to type it all again from scratch. Bad usability!

Also, doing it on-blur means that the user will not get a chance to
correct the error at all, if he clicks directly on submit while editing
the field. This might be what caused your bug report.

It is much better to mark the field as erroneous (red crosses or
borders spring to mind) and prevent submission of the form until the
problem is fixed.

/L
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,145
Messages
2,570,826
Members
47,371
Latest member
Brkaa

Latest Threads

Top