473,809 Members | 2,842 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

date format in forms?

hi everyone,

in my form i have to take some date information in dd-mm-yy format.
but i don't want user to use tabs while typing. for example s/he
should simply type 280104 but 28/01/04 must appear.

what can i do for that?
should i use three input tags? but then, how can i make the cursor
jump to the next field when typing in current field is done?
or if i use one input tag, how can i keep '/' signs in the field fixed
when user types the date?
Jul 20 '05
25 19870

"Brian" <us*****@juliet remblay.com.inv alid> wrote in message
news:10******** *****@corp.supe rnews.com...
Harlan Messinger wrote:
Brian wrote...
If it's unclear how the user's name should be represented,
shouldn't there be a single name field? Let the user type it in
as they see fit.
Forms don't split up entry of people's names just for fun. The
essential need behind split entry of the user's name is to be able
to sort alphabetically on family name.


I suppose. But a database can sort on a name, whether first + last or
last only.


Except in Iceland and some other countries, the need is to sort on family
name, so first + last is inadequate, and unknown order is worse.
I think addresses would be much easier that way, too. Where does
the postal code go? After the city (and state), like in the US,
or before it, like in France?
The requirements of most applications require the address data to
be split. I don't know about other countries, but U.S.
organizations, to get favorable postage rates, need to be able to
print mailing labels in order by ZIP (postal) code.


In that case, I might go for 2 fields: a mailing label <TEXTAREA>, and
a postal code for sorting. Of course, that raises the potential
problem that people might then not put the code in the <TEXTAREA>.


Then you're asking people to enter the same information twice. And it still
leaves state and city unavailable.
It's really hard to build a parser that knows all the rules
necessary for international commerce, but in spite of your
suggestion to the contrary I think most people can be counted on to
know which part of their address is the street, which is the city,
which is the state, and so on.
My point wasn't that users would get confused. My point was twofold:
(1) users can enter their address more easily in a textarea compared
to 6 input type=text elements. (2) it's not the users who will get
confused, it's the organization. It's hard for a commerce site to know
the proper address format for the US, France, China, Tanzania, etc.


Right, and it's a two-edged sword, because the address is needed for two
basic purposes: (1) mailing, and (2) data processing. You are correct that,
given the components of arbitrary addresses around the world, it is
challenging to put them back into the correct order for mailing. And on the
other hand, if the user enters the address in a single block, it is
challenging to break it up into the needed components.
Once they collect the city and postal code in separate inputs, how
will they know how to lay them out on their mailing labels?
I *think* that fewer problems arise if a package winds up being shipped to

55 Avenue des Paradisiers
Brussels, Brabant 1160
BELGIUM

instead of

Avenue des Paradisiers, 55
1160 Brussels
BELGIUM

than arise if the software thinks 1160 is the city and Brussels is the state
and therefore never sends the requested material at all.
from other countries, and indiscriminatel y applies locale-specific
validation rules for postal codes, phone numbers, and so forth.


Again, for telephone numbers, one should be "liberal in what you
accept": allow 0 or 1 at the beginning, allow space and formatting
characters ()-, and allow a variable amount of digits. This assumes
international visitors. For a site restricted to a country, a more
restrictive format may be appropriate.


Jul 20 '05 #11
Harlan Messinger wrote:
Brian wrote...

In that case, I might go for 2 fields: a mailing label
<TEXTAREA>, and a postal code for sorting.


Then you're asking people to enter the same information twice. And
it still leaves state and city unavailable.


It's trivial to look up a city/state by zip code.

--
Brian (remove ".invalid" to email me)
http://www.tsmchughs.com/
Jul 20 '05 #12
Neal <ne*****@yahoo. com> wrote:
A name field is filled in by the user with their name in their
preferred form, so one field is fine.
It depends. The point that Andreas made is a good one when further
processing requires a given name and a surname (if they exist) to be
recognized. We cannot really recognize them from a name alone, without
further information.

But quite a many forms, if not most, that prompt for a name will use it
as an atomic unit only, e.g. to be printed in an envelope, and stored
into a data base for that purpose only. (If you need to identify
customers, you really need unique customer identifiers assigned by you,
instead of unique personal names.)
Dates, though, have other uses. You might want to order things
chronologically , - -


Yes, and most use of dates requires a separation of year, month, day of
month. But how you achieve that is a different thing. Maybe I'm strange,
but I find it more comfortable to type 2004-07-15 or 2004 07 15 or
whatever needs to be typed than to type 2004 followed by 07 followed by
15 in three different fields, _even if_ there's "auto-tabbing" (i.e., the
cursor automatically moves to the second field after I have typed in four
digits into the first one) and even though I know well the idea behind
that. A date is a unit of information to me. So is my name, but I find it
much more natural to use different fields for the different components of
the name.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

Jul 20 '05 #13

"Brian" <us*****@juliet remblay.com.inv alid> wrote in message
news:10******** *****@corp.supe rnews.com...
Harlan Messinger wrote:
Brian wrote...

In that case, I might go for 2 fields: a mailing label
<TEXTAREA>, and a postal code for sorting.


Then you're asking people to enter the same information twice. And
it still leaves state and city unavailable.


It's trivial to look up a city/state by zip code.


Well, that's true--if the business has invested in a postal database and
keeps it up to date--and does the same for every country from which business
might be coming in.

Jul 20 '05 #14
JRS: In article <ON************ *****@news-server.bigpond. net.au>, seen
in news:comp.infos ystems.www.authoring.html, Lachlan Hunt <lachlan.hunt @
lachy.id.au.upd ate.virus.scann ers> posted at Thu, 15 Jul 2004 07:57:34 :
koray wrote: Also, if
your interested, and would like to use the ISO 8601 format, then use
this regex.

/([0-9]{4})[-\/]?([0-9]{2})[-\/]?([0-9]{2})/
this allows
YYYY-MM-DD
YYYY/MM/DD
YYYYMMDD
(as well as incorrect versions like YYYY/MM-DD, but that doesn't really
matter, as long as it supports the correct versions)


It is easy enough, IIRC, to use a back-reference to force the second
delimiter to match the first.
what can i do for that?
should i use three input tags? but then, how can i make the cursor
jump to the next field when typing in current field is done?


Drop-downs or multiple text fields are reasonable, perhaps desirable,
for casual visitors and/or management staff. For data-entry staff
entering multiple dates routinely, ISTM best to require the order YMD,
and to allow any delimiting whatsoever; a RegExp /(\d+)\D+(\d+)\D +(\d+)/
will pick out the fields. You could also allow /(\d\d\d\d)(\d\d )(\d\d)/
or /(\d+)(\d\d)(\d\ d)/ and use whichever matches.

As may have been noted, I am not a professional typist. Yet I can enter
a date by typing 8-10 characters in about half the time I need for using
three drop-downs.

Automatic insertion of delimiters needs careful programming to allow for
backspace & pasteing.

For javascript date input and validating, see via below; note first what
the FAQ has to say on the subject.

The shortest and the fastest code are both short enough to be deployed
client-side.

P.S. If the application is not international, then it is reasonable to
stipulate the locally-preferred Y M D order, if native staff are being
used.

--
© John Stockton, Surrey, UK. ?@merlyn.demon. co.uk Turnpike v4.00 IE 4 ©
<URL:http://jibbering.com/faq/> JL / RC : FAQ for news:comp.lang. javascript
<URL:http://www.merlyn.demo n.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demo n.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
Jul 20 '05 #15
@julietremblay. com.invalid says...
It's trivial to look up a city/state by zip code.


Only if your app is purely US-centric.

street Address: 1 High Street
zip code: 2480
country: Australia

In Australia, this could end up as being any one of half a dozen
different addresses. Multiple nearby small towns or suburbs can share a
common "zip" code (postcode). There is definitely no uniqueness of
street names within a postcode.

Geoff M
Jul 20 '05 #16
gmuldoon wrote:
Brian says...
It's trivial to look up a city/state by zip code.
Only if your app is purely US-centric.


Or France-centric, or Germany-centric, or...
street Address: 1 High Street
zip code: 2480
country: Australia

In Australia, this could end up as being any one of half a dozen
different addresses. Multiple nearby small towns or suburbs can share a
common "zip" code (postcode). There is definitely no uniqueness of
street names within a postcode.


That's surprising, and good to know. So what does the postal code add
to addresses in Australia?

--
Brian (remove ".invalid" to email me)
http://www.tsmchughs.com/
Jul 20 '05 #17
@julietremblay. com.invalid says...
1 High Street
zip code: 2480
country: Australia

In Australia, this could end up as being any one of half a dozen
different addresses. Multiple nearby small towns or suburbs can share a
common "zip" code (postcode). There is definitely no uniqueness of
street names within a postcode.


That's surprising, and good to know. So what does the postal code add
to addresses in Australia?


Nominates a preliminary postal distribution centre for subsequent
further manual sorting, where local staff will filter on the
city/town/suburb and then street fields.

In the above example 2480, the leading digit of the postcode indicates
the state (NSW/ACT=2, VIC=3, QLD=4, etc), the 480 takes it within NSW to
the Lismore distribution centre.

2480 can mean Lismore (city), Goonellabah (suburb of Lismore), Nimbin
(village 30km from city), Dorroughby (rural district), etc. Just
checked using link below - 72 different delivery areas! At least 3-4
High Streets that I know of in that set.

2481 will go to nearby Byron Bay distribution centre (for Byron Bay,
Suffolk Park, etc.)

See:
http://www1.auspost.com.au/postcodes/

Geoff M
Jul 20 '05 #18
"gmuldoon" <gm************ *@scu.edu.au> a écrit dans le message de
news:MP******** *************** *@news.asgard.n et.au
street Address: 1 High Street
zip code: 2480
country: Australia

In Australia, this could end up as being any one of half a dozen
different addresses.


In france a Zip code could also be shared by several towns, so the same
number and street name for a given zip code could possibly belong to one
town or another.

Jul 20 '05 #19
Pierre Goiffon wrote:
In france a Zip code could also be shared by several towns, so the same
number and street name for a given zip code could possibly belong to one
town or another.


I was about to argue with you when I remembered where you're from.
;-) But this suprised me even more than the news about Australian
codes. AIUI, each town or city gets a 2 digit code -- the first two
digits of the postal code -- and uses the last 3 digits for internal
use (e.g., divide by arrondisement). But I suppose the rural regions
are different, and share a 2 digit code among several towns?

--
Brian (remove ".invalid" to email me)
http://www.tsmchughs.com/
Jul 20 '05 #20

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
6375
by: insomniux | last post by:
Hi, I am having a problem with formatting the default value of a date field. It has been discussed earlier in many topics, but still I cannot solve the problem. What's happening: I have various forms which are based on an ODBC-linked tables. In one of the forms, I have a control which shows the date of a date field in my database (storage type=date). The default value for the control is set to '=Date()', the format property is set to...
20
35645
by: andreas | last post by:
When I copy a vb.net project using date formats from one PC with a windows date format f.e. dd/mm/yyyy to another PC having a format yy/mm/dd then I get errors. How can I change for a while in the project the date format in vb.code ( not in Windows) and how can I find out which date format the PC Windows is using. Thanks for any response
7
6825
by: Richiep | last post by:
I am trying to get a UK format date of dd/mm/yyyy. Why does the following subroutine not return a valid date in a web form? The date returned is #12:00:00 AM# but the date I entered into the text box was 24/06/2006. The other solution I have tried is given by the following two lines that do not compile because a value of date type cannot be converted to datetime:
4
2740
by: saintor1 | last post by:
Access 97 - I want the date format YYYY-M M-DD to show everywhere. My problem is that I deal with French and English versions. And don't want to play with Windows Regional Settings. In the format property of a control, it is easy to enter YYYY-MM-DD But it won't work in French versions. In them, AAAA-MM-JJ will. Using format(MyDate,"yyyy-mm-dd") in the controlsource doesn't sem to
16
11919
by: Mik | last post by:
I apologise if this post seems a little basic, but I am a newbie and have NO access knowledge. I have downloaded the Accounts Ledger from the Microsoft Website. It allows the user to review a report of transactions between a Start & End date. The Tables and forms i believe are UK format "dd/mm/yyyy", However, when I click on "Review Reports" and enter the date as UK "dd/mm/yyyy", it returns nothing.
1
1885
by: Gilz | last post by:
Hi I am having trouble with the transfertext acexportdelim function. I have written several routines that export queries with date fields. I have put format statements in the download queries as so that the data is exported as dd/mm/yy. Every time i run this it exports the dates as dd/mm/yy nn:hh:ss i really don't understand why.
1
4045
by: Maciej07 | last post by:
Hello, We are using SQL server 2000 on W2k Server and MS Access 2000 ADP (like front-end). Now we try to change operating system for SQL Server 2000 from W2k to W2k3 and we found problem with date format - we receive error: "Cannot convert date type varchar to datetime". Datetime used in application are sent to SQL Server 2000 in format YYYY-MM-DD as varchar. (in Query Analyzer all view/query works fine but when application sends it...
10
5827
by: ARC | last post by:
Hello all, General question for back-end database that has numerous date fields where the database will be used in regions that put the month first, and regions that do not. Should I save a date format in the table design, such as: mm/dd/yyyy? What I've done for years is to store the date format in date fields, then on the forms, based on their region, I would set the date formats on form_load
3
421
by: Tony WONG | last post by:
The date format (control panel) of testing (VS2005) and production platform are yyyy/mm/dd. i run preview from testing (VS2005). The date format is yyyy/mm/dd however, when i put the code to production platform. The date format is dd/mm/yyyy what should i look to? Thanks a lot.
5
8254
by: Matsam | last post by:
Hello, I have an Access program with 4 forms. In the load event of the main form, I need to set the system date format to British. Can anyone please give the code for setting the system date format ? Thanks in advance Matsam
0
9721
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9600
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10376
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10375
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9198
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7651
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6880
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5548
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5686
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.