I have to enter the bank account number which is 16 digits
my question is how we can validate if user enters only zero's (0),
like 000000 or 00000000 or 000000000000
If user only enters the multiple zero's means how I can validate, is there any Java script validation to avoid the multiple zero's, please any one give clarification for me, please find the attachment below.
Thanks in advance
Use Regex, and see if it's ok or not.
Try to get the pattern you want by using these examples. You have one for a credit card.
This is the asset: Regex Ho-to.
This asset is just to give you examples and different patterns to different situations.
https://jsmarques13.outsystemscloud.com/RegexHowTo/RegexHowTo
Regards,
Márcio
Thanks, but still struggling on that
You need to say what is the issues you are facing, and what you couldn't do with the solution I gave :)
Give me a detailed description. That way I can show you an example, and (maybe) you can make it work.
I have done an example and how to use it!
SO...
1-I created a screen and an input, that input will be verified each time there is a change
2- By using the pattern on the javascript function you can see if the pattern was found or not. That means if not, it's not a credit card, if it was it's a credit card. This javascript was taken on the asset I shared previously.
3- And then you have the feedback messages pointing to the result.
If you want to limit the number of digits to 16, you need to do a length of the string and see how many digits it has, like this:
This is just an example. Now you must do and adapt for your logic... You can even do that on the regex. Do what you must do
Have a look at this link and test it!
https://marcio-carvalho4.outsystemscloud.com/CreditCard/CreditCardRegex?_ts=637754362368224996
I also will share the module
Kind Regards,
I am not sure if I understand your question correctly, but if you can only enter numbers and it cannot be 0 or a multiple of zeros (0000000 etc.), is it not solved by making the input field of type number and making it mandatory? The 0 would be seen as empty and thus it would automatically be validated as not being valid.No need for Javascript or regex, but just using Outsystems default validations by this.You can check for example this demo application from the forge: https://www.outsystems.com/forge/component-overview/8878/order-management (search for Order Management). In this application, you can for instance take a look at the validation on the OrderDetail page, "Input_Quantity" field on the ProductForm.If you need a different kind of check and/or error message, please let me know.Kind regards,
Betteco
Hi Vel,
You can validate if the variable is equal to or less than 0.
Example: If its a text variable, u can validate like, if(TexttoLonginteger(Yourvariable)<=0,True,False)
or if its an integer,
you can use the condition, if(Accountnumber<=0,True,False). then show the validation error message.
Refer to the demo link: https://wasim.outsystemscloud.com/Reactivetest/Test?
Hope, this is what the validation you are looking for.