Date Text box

P

pjSoni

Hi,

I need Javascript text boxt which automatically includes space and
character for date when anyone comes text box should looks like
'yyyy-mm-dd'. When pressing each character converting in to typed
number.


Thanks a lot.
 
J

Jonas Raoni

pjSoni said:
I need Javascript text boxt which automatically includes space and
character for date when anyone comes text box should looks like
'yyyy-mm-dd'. When pressing each character converting in to typed
number.

There's a lot of masking codes on the internet, on my site there are two
that you can take a look:

#1 <URL:http://jsfromhell.com/forms/restrict>: My friend has done this
one, it also checks the current character position, so it works
reasonably right.

#2 <URL:http://jsfromhell.com/forms/masked-input>: I was taking a look
at this old code and it's horrible, I'll change as soon as I get some
motivation... =/
 
R

RobG

Jonas Raoni wrote:
[...]
#1 <URL:http://jsfromhell.com/forms/restrict>: My friend has done this
one, it also checks the current character position, so it works
reasonably right.

Hey presto, the biggest issue with XHTML - all I see of your page is an
error:

"XML Parsing Error: mismatched tag. Expected: </li>. Location:
http://jsfromhell.com/forms/restrict Line Number 241, Column 73:

than the mask, the "extra" characters of the mask will be ignored.</p>
------------------------------------------------------------------------^

"
 
T

TheBagbournes

RobG said:
Jonas Raoni wrote:
[...]
#1 <URL:http://jsfromhell.com/forms/restrict>: My friend has done this
one, it also checks the current character position, so it works
reasonably right.

Hey presto, the biggest issue with XHTML - all I see of your page is an
error:

And anyway, the masking code won't work because you can't tell in
javascript where in a field the cursor is. The scripts use the
field.length attribute, so will work only when typing at the end of a
field, not when you've arrowed or moused back into it to edit it.

You can't really do this very well on keypress, you have to do it on change.
 
T

Thomas 'PointedEars' Lahn

TheBagbournes said:
RobG said:
Jonas Raoni wrote:
[...]
#1 <URL:http://jsfromhell.com/forms/restrict>: My friend has done this
one, it also checks the current character position, so it works
reasonably right.

Hey presto, the biggest issue with XHTML - all I see of your page is an
error:

And anyway, the masking code won't work because you can't tell in
javascript where in a field the cursor is.

Yes, you can.


PointedEars
 
J

Jonas Raoni

RobG said:
Jonas Raoni wrote:
[...]
#1 <URL:http://jsfromhell.com/forms/restrict>: My friend has done this
one, it also checks the current character position, so it works
reasonably right.

Hey presto, the biggest issue with XHTML - all I see of your page is an
error:
"XML Parsing Error: mismatched tag. Expected: </li>. Location:

I was changing some things internally and I ended up damaging some
codes, I've perceived and fixed just two days after haha, if you want,
try the link again =b
 

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

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,165
Latest member
JavierBrak
Top