473,809 Members | 2,724 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
On Thu, 15 Jul 2004 16:16:02 +0000 (UTC), "Jukka K. Korpela"
<jk******@cs.tu t.fi> wrote:
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.


Your post inspired me to try the use of CSS to present three form
fields as one. The following fragments give the gist:

..dateinput {
border: 2px inset #eeeeee;
background: #ffffff;
color: #000000;
}

..dateinput input {
border: 0;
text-align: center;
}

.....

<span class="dateinpu t">
<input type="text" size="4" maxlength="4"> -
<input type="text" size="2" maxlength="2"> -
<input type="text" size="2" maxlength="2">
</span>

This appears, in IE and Firefox on Windows, like a single text field
with three input parts separated by hyphens. It's a bit like the
fields Windows uses for entry of numeric IP addresses in Control
Panel. Some scripting would be necessary to implement the
"auto-tabbing" behavior.

Of course, there's no way in CSS to say "make this look like a text
field", so the specification of the dateinput class is specific to my
configuration in Windows, but I wonder if you would find this entry
more natural since it looks like one field.

(I don't necessarily recommend the above approach. It's just an
experiment.)

-Claire
Jul 20 '05 #21
Claire Tucker wrote:
Your post inspired me to try the use of CSS to present three form
fields as one. The following fragments give the gist:
<snip>

Doesn't look right in Firefox 0.9 on Fedora Core 2:
http://ecritters.biz/inputfieldthing.png
Jul 20 '05 #22
On Sun, 18 Jul 2004 18:59:29 -0400, Leif K-Brooks
<eu*****@ecritt ers.biz> wrote:
Claire Tucker wrote:
Your post inspired me to try the use of CSS to present three form
fields as one. The following fragments give the gist:
<snip>

Doesn't look right in Firefox 0.9 on Fedora Core 2:
http://ecritters.biz/inputfieldthing.png


Well, as I noted there is really no way to make it look "right" if
that means to look like a normal INPUT field would look, since CSS
doesn't allow rules to borrow style properties from other selectors.

I expected it to do odd things in some cases, since the properties I
chose to set were very limited. In order to safely re-style INPUT
fields (which is, of course, a bad idea in most cases) it's best to
override a whole tonne of different properties to ensure that no
browser has an odd rules in its user-agent stylesheet which give
unexpected results.

With that said, Firefox's rendering is quite odd. I wonder what CSS
properties made it draw the input field background over the border of
the parent...

Best regards,
-Claire
Jul 20 '05 #23
Claire Tucker wrote:
With that said, Firefox's rendering is quite odd. I wonder what CSS
properties made it draw the input field background over the border of
the parent...


Without doing any testing, my guess is that the input box has a height
greater than 1em, so its background covers the span's border.
Jul 20 '05 #24
"Brian" <us*****@juliet remblay.com.inv alid> a écrit dans le message de
news:10******** *****@corp.supe rnews.com
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.
;-)


:)
I answered beacause I practice mutch this subject in my last job - I worked
4 years for www.Webcity.fr, a cultural news website for citizens, the place
where you can find what to do tonight in your town, all the concerts for the
months to come and mutch more (to summarize it's a cultural agenda and an
adressbook). So as the site at this time covered more than 80 towns in
France, the question of zip codes was pretty important in our database.
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?


Not exactly. France has a long history, and a long tradition of
administrations , so it's a bit complicated. First, there are two main
nomenclatures used in France : postal zip codes (PTT) and INSEE ones. For
adress, that's of course the first to consider.

Now, France is divided in /régions/, and then in /départements/ (not sure of
the translations sorry, and I'm afraid it is one of these "faux ami" words :
exactly the same orthography but not the same meaning at all).

So, the regions are identified by their names, and departements have an
associated unique number. For exemple I'm now writing to you from St Martin
d'Hères in the /département/ "Isère" (38), /région/ "Rhônes Alpes". The zip
code is 38400, and the first two numbers are as you can see the number of
the /département/. A few month ago I was living in the same /région/ but
another departement, "Ain" and the postal zip code begins with 01, the "Ain"
number. You can see also this /département/ number at the end of all french
car number plates (exemple 4821 WX 38).

For metropolitan France (the DOM/TOM -Guyane, St Pierre et Miquelon, ...-
have a different structure of postal zip codes I think) the 3 last numbers
are to identified the place where you leave in that /département/. Whitch is
not the /commune/ (town) neither a /groupement de communes/ (towns union),
neither a /canton/ (group of towns defined for elections). I don't know at
all the origin of this division, why some towns have the same postal zip
code... Well, must be some french postal employees that decide this a long
time ago. As for other public services, postal services are a state monopoly
in France and we're really used to these kind of situations :)

Jul 20 '05 #25
"Claire Tucker" <fa**@invalid.i nvalid> a écrit dans le message de
news:hj******** *************** *********@4ax.c om
Your post inspired me to try the use of CSS to present three form
fields as one. The following fragments give the gist:

.dateinput {
border: 2px inset #eeeeee;
background: #ffffff;
color: #000000;
}

.dateinput input {
border: 0;
text-align: center;
}

....

<span class="dateinpu t">
<input type="text" size="4" maxlength="4"> -
<input type="text" size="2" maxlength="2"> -
<input type="text" size="2" maxlength="2">
</span>


For non CSS browser you should at least add signifiant labels for each input
tag. You could hide them if CSS is enabled via a display:none for exemple

Jul 20 '05 #26

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
10633
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10114
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
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
5686
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4331
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3860
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3011
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.