matheus
Posts: 386
|
| Posted: 07/26/2004, 7:21 AM |
|
Hi,
I have a textbox and need a client input mask. I create one in typelib.xml, but it's not like I need.
When you create a Client Input Mask I need some optional value.
For example: A money value. It could be 3,400.00 or 3.45 but if I create a input mask "0,000.000", it need to put all the numbers.
I'm looking for a kind of client input mask rule optional.
I know that 0 is number and L is letter.
I could do this with javascript but made in CCS is much better.
Thanks, sorry english...
_________________
Matheus Trevizan
Dynamix Software Ltda.
Blumenau SC Brasil
www.dynamix.com.br |
 |
 |
DaveRexel
Posts: 50
|
| Posted: 07/27/2004, 3:50 AM |
|
::
Hello Matheus
As you are working with numbers this might be useful
http://docs.codecharge.com/studio/html/Components/Prope...Format.html?toc
_________________
/Dave
RexDesign CodeCharge Studio Tutorials
http://rexdesign.com/ccs/ |
 |
 |
matheus
Posts: 386
|
| Posted: 07/27/2004, 6:13 AM |
|
Hi Dave,
This Number Format doesn't work with input mask, it's just to format edit and format label.
In Validade Entry properties is writted:
"Specify an input mask to be used to determine the validity of the field value.
The following symbols can be used for the mask:
0 - any digit,
L - any character in the lower or upper case.
All other symbols should be the same as in the mask string.
For example, mask (000) 000-00-00 will allow entering the telephone in format (123) 123-45-67. Mask LLLL-LL00 will allow outputting the alphanumeric code with the sign in the middle, for example: ABCD-EF35."
I tried with Regular Expression in Validade Entry, but it works just after submit, so I think that Regular Expression in Validade Entry action is the same thing that the action Regular Expression Validation.
I'm looking for a input mask that validate entry and the user doesn't need write decimal separator and group separator, if someone knows how.
Thanks,
_________________
Matheus Trevizan
Dynamix Software Ltda.
Blumenau SC Brasil
www.dynamix.com.br |
 |
 |
DaveRexel
Posts: 50
|
| Posted: 07/27/2004, 6:30 PM |
|
::
Hi Matheus
As I'm away from my development machines I don't have CCS to test but I think that the Input Mask will not help as you will need a 2-step process
step 1 = strip all non-alphanumeric characters from the string
step 2 = reformat the result to your required format
So Javascript or Custom Code in whatever scripting language you are using in your project maybe the only option.
The javascript function here is being reformatted by the forum to show sad-smiley in the javascript (hello, UltraApps.com "code tags should not produce smileys in the code tags!!!") grrr, but below is a very good javascript function that can be adapted to your purpose (remove the space between the first colon : and the first bracket ( before using it)
function checkPhone(num){
return /\s*?(?: (?:0[^0]\d{8})|(?:00[^0]\d{10}))\s*?$/.test(num.replace(/\+/,"00").replace(/\-/,""));
}
Here's the bad output produced by the bug in this forum's code
function checkPhone(num){
return /\s*?(? ?:0[^0]\d{8})|(?:00[^0]\d{10}))\s*?$/.test(num.replace(/\+/,"00").replace(/\-/,""));
}
As you may already have a working javascript it might not be of much use anyway.
Sorry I cannot be of more assistance, hopefully you will get help from others on this forum
Regards
_________________
/Dave
RexDesign CodeCharge Studio Tutorials
http://rexdesign.com/ccs/ |
 |
 |
matheus
Posts: 386
|
| Posted: 07/28/2004, 4:28 AM |
|
Thanks Dave,
But I didn't make with Javascript, I do a custom code in server, and in a separate Java file I format and return the string to show in form.
Thanks,
_________________
Matheus Trevizan
Dynamix Software Ltda.
Blumenau SC Brasil
www.dynamix.com.br |
 |
 |
|