#1 2016-12-23 21:44:57

Kasito
Banned
Registered: 2016-08-05
Posts: 58

How we can validate more than one input "at the same time"

I have a contact form and want to validate 3 inputs controls with one submit buttons.  Not the case in the app sample.

How do I implement that?  Example with. Name = if  alphabet, email = if email and phone = numeric.

I also notice there is no Numeric but alphanumeric. What can won do in this case?

Thanks in anticipation.

Offline

#2 2016-12-24 13:21:40

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,657
Website

Re: How we can validate more than one input "at the same time"

Hello Kasito,

App Builder provides several "validator" actions like "IsEmail", "IsAlpha", "IsNumeric", "IsAlphaNum", etc., etc. You can take a look at the "Validator" application sample to view lot of these actions working. If you no need these actions maybe you can use the "IfEx" action to "validate" more than one input at the same time.

However, if you need to use these actions (for your convenience) a probably way to validate more than one input is just to proceed in a sequential way and by using the "If" action or the "IfEx" action at the end.

I also notice there is no Numeric but alphanumeric. What can won do in this case?

I am not sure if understand but we have the "IsAlpha", "IsNumeric" and "IsAlphaNum" actions, which cover the "only alphabetic characters", "only numeric characters" and "only alphabetic and numeric characters" cases.

Anyway, remember that ALWAYS you send user input data from your application to your application's server, that user input data must be validated again, since a client side application can be defeated, for example.

Online

#3 2016-12-24 23:14:55

Kasito
Banned
Registered: 2016-08-05
Posts: 58

Re: How we can validate more than one input "at the same time"

Thanks David for your concern.  I have seen the validation sample in app builder, which has Validation Actions as you mentioned above.  But they are all on individual bases - each with its button.

My questions is, how can you have for example 3 inputs in a view and use single button to validate them and submit the respective data to a server.

Thank you.

Offline

#4 2016-12-24 23:21:00

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,657
Website

Re: How we can validate more than one input "at the same time"

Hello Kasito,

Something like this?

IsAlpha "[Input1.Value]" "[Result1]"
IsNumeric "[Input2.Value]" "[Result2]"
IsAlphaNum "[Input3.Value]" "[Result3]"

IfEx "[Result1] == 'true' && [Result2] == 'true' && [Result3] == 'true'"
  AlertBox "Inputs validated!" "success"
EndIf

Online

#5 2016-12-28 09:33:11

Kasito
Banned
Registered: 2016-08-05
Posts: 58

Re: How we can validate more than one input "at the same time"

Hi David

Your sample works great, but one issues is that - when i use a First and Second name for example; Kaase Gbertyoh.
The script does not support the space in between the two names.

How do i figure this out?  cos i dont want to use different control for each name.

Tanks

Offline

#6 2016-12-28 10:16:35

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,657
Website

Re: How we can validate more than one input "at the same time"

Hello Kasito,

Kasito wrote:

Hi David

Your sample works great, but one issues is that - when i use a First and Second name for example; Kaase Gbertyoh.
The script does not support the space in between the two names.

How do i figure this out?  cos i dont want to use different control for each name.

Tanks

What do you want to validate in something like "Kaase Gbertyoh"? The input's length? Something else?

Online

#7 2016-12-28 10:25:32

Kasito
Banned
Registered: 2016-08-05
Posts: 58

Re: How we can validate more than one input "at the same time"

I want to validdate IsAlpha for "Kaase Gbertyoh"  but the script is only accepting "KaaseGbertyoh"

What do i Do

Offline

#8 2016-12-28 10:28:24

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,657
Website

Re: How we can validate more than one input "at the same time"

Hello Kasito,

Then, one of the possibles ways, can be to remove the possible spaces before the "IsAlpha" test. You can try with the StrReplace or StrReplaceAll actions.

Online

Board footer

Powered by FluxBB


Copyright ©2018 DecSoft. All rights reserved.