Expand my Community achievements bar.

AEM6.5 - Adaptive forms -Numeric input field to trigger rule editor validate while typing itself , instead of on focus out

Avatar

Level 4

Hello,


I am using numeric input field, with an display as 0.00 ,
so If I input 999 and focus out it will show in the field as 999.00, it will also trigger the required rule editor validations, when I focus out on that field.

 

 

Requirement:-

I need to trigger the rule editor validations ,with I am still typing in the field. instead of after focusing out on the field.
So if I keep typing like 1001 , it must show an error message in the field "that the value is grater that 1000"

 

Issue:-


1>If I type in 999 and stop ,for a while ,it must show 999.00 in the field
2> while typing how to trigger the rule editor validation for the numeric field , how to trigger the rule editor validation to check for error

3> if I focus-in again  i.e click on the field again ,it must show 999 again, instead of 999.00. 

I should able to remove any number say make it 9 or again make it to 99

 

 

Could you please provide inputs as how can I achieve it

 

Regards,

Srinivas

5 Replies

Avatar

Employee

Hi @Srinivas_Opti,

Can you please let me know if you are working with Adaptive Forms or the LiveCycle forms. In both cases you can achieve the usecase by using different events for the fields like "Display Pattern ", "Validation Pattern" and finally the "Edit Pattern". You can play around these events and achieve the specific usecase.

 

As for the validation events you can make use of the different events like change event and the exit event where you can add the scripts to validate the value entered in the field.

 

Thanks

Pranay

Avatar

Level 4

@Pranay_M  Thanks for the input.

 

I am using adaptive form.

 

It will be very helpful,if possible to provide any sample code for it.

 

Say If I have input field id is "numericid"

 

Regards,

Srinivas 

Avatar

Employee

Hi @Srinivas_Opti ,

Please find below the solutions for the issues:

Issue:

>If I type in 999 and stop ,for a while ,it must show 999.00 in the field
3> if I focus-in again  i.e click on the field again ,it must show 999 again, instead of 999.00. .

Solution:

1. Drag and drop a numeric box component and set the below 2 properties

2. Under the basic tab set the value of "Maximum Number of Digits" to 3

Pranay_M_0-1740580778797.png

3. After that, under the patterns tab set the below properties.

Pranay_M_1-1740580879048.png

4. After following the below steps you should be able to achieve the use case for the first and third points.

Issue:

2> while typing how to trigger the rule editor validation for the numeric field , how to trigger the rule editor validation to check for error

Solution:

You can use the validation patter section to check the value for the field and if incase the validation pattern is not working then you can make use of the rule editor to achieve the usecase.

Pranay_M_2-1740581079670.png

Thanks
Pranay

 

 

Avatar

Level 4

Hello @Pranay_M ,

 

Thanks for the detailed information.

 

Noticed that this work when we focus out on the field.

 

I want this validation to work when we still typing in the field.

 

Regards,

Srinivas 

Avatar

Administrator

@workflowuser @gvdpatida1 @Rahul_P @NitroHazeDev @sunnymarwaha @0experience Can you take a quick look at this question? Any guidance you can provide would be much appreciated!



Kautuk Sahni