-
22 Jan 2008 7:31 AM #31
Yesterday evening I tried to tamper with the script .. Most received no positive result
-
22 Jan 2008 8:45 AM #32
Did you try...
Did you try...
Did you try the following strategy?
- Listen on keypress. If the pressed key is delete or backspace simply store the actual text and the actual key pressed and the actual cursor position (I don't know if there is a way to distinguish from the '.' and the Delete key....)
- listen on input. When this happens the text is already changed. Now you can guess what happened from the stored values. It Is similar to the way the paste is managed in FF.
PS: I tried the other script you posted but it doesn't manage paste (Ctrl+V doesn't work and if you right click on the field and select paste on the menu it pastes the text even if wrong)
Ciao
-
23 Jan 2008 4:21 AM #33
condition "===" represent???Code:if(this.inputTextElement.value.length === 0){ this.inputTextElement.value = this.viewMask; }
i see this in the first post that have a maskinput
-
23 Jan 2008 4:27 AM #34
A link to a brief explanation
-
23 Jan 2008 4:30 AM #35
I did not know that heheheh
=== - is exactly equal to (value and type)
x==5 is true
x==="5" is false
-
30 Jan 2008 4:32 AM #36
Nice...
Nice...
...but:
If i understood this plugin right, it is only possible to mask a field for a known length. So if I want to mask it for eMail or a telephone number which length isnt known exactly, it wont work. Right ?
My telephone number may look like:
(+49) 40684
(+49) 805-6568452
So i would be in need of wildcards, something like this:
(+99) 9*
(+99) 9*-9*
or a combination so both a accepted at the same time
It would also be nice if i could give a regular expression for the whole field and not only for a digit, so it would be possible to test for a valid email adress with a regexp like this:
Ok, as i m typing and thinking about it, for eMail Adresses masking input didnt seem to be the right way to do it. Maybe its easier to verify the input after its typed. But would be nice if user couldnCode:^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$
-
30 Jan 2008 9:04 AM #37
What is the wanted behaviour?
What is the wanted behaviour?
Is the following one the wanted behaviour?
Suppose I have a mask to enter an phone number
Now my phone number can be 0123/123456 or 01/12345678
So you write this mask (or something like this):
99X[0-9]*X/999999X[0-9]*X
In the field you initially see:
__/______
Now, if you want to enter 0123/123456, you type the 0 and 1 and you have:
01/______
Now, if you type 2 the mask become
012/______
Now, if you type 3 the mask become
0123/______
Now, if you type 0 the mask become
01230/______
To move after the "/" you have to move using the arrows key, or you have to type /
Correct?
The feature is not implemented, but I don't think it's too difficult to do (look at the injectValue method, and getValidatedKey method... ). I don't have time in this moment, but maybe I will look into this (I have the problem of phone numbers too, but not now...) If you need it now, I accept a patch
.
PS: before doing something i will wait for feedback on the wanted behaviour.....
-
30 Jan 2008 4:23 PM #38
Nice plugin.
However I have found a bug on firefox with linux (works in windows) . If you delete characters in a textfield too fast (When you let your finger on the button, it works otherwise) the mask is also deleted which cause unwanted behavior.
You then need to blur the textfield and refocus so that the mask comes back.
I'll take a look at what could be the cause of it when I'll have some time.
Anybody else have this bug...?
-
31 Jan 2008 3:15 AM #39
Sounds goodTo move after the "/" you have to move using the arrows key, or you have to type /
Correct?
Sry that i have no patch for that. By now i m not so good in javascript 
I tried to use your plugin with a combobox as "search field". It works well... but if i leave the combobox with a mouse click in another field the typed text vanishes ... Do i have to change something for Combo fields ?
I ll watch this thread maybe i can switch from my vtypes to this plugin at some point...
Nice work!


-
4 Feb 2008 6:50 AM #40
new version
new version
- add support to opera (tested with latest version)
- fix clearWhenInvalid behaviour: now when the second parameter of constructor is false when the field loses focus and the text is invalid the field is not cleared.



Reply With Quote