Email/ID (Single Line Text Box) Confirmation

vishwadhatha
Tera Contributor

Good Morning Team,

 

 Something I am working on requires me to add a text box for the ID Number (single line text) and then asks for another text box to confirm the ID Number is correct. Is there any UI policy or such that will have the system check if the two variable inputs are the same? How should I go about doing this?

 

Thank you,

 

VD

6 REPLIES 6

Siddhesh Gawade
Mega Sage
Mega Sage

Hello @vishwadhatha ,

 

Please follow below steps.

1. Create two variables, for example TEST 1 and TEST 2.

2. Create a UI policy, which will show the TEST2 variable only when TEST is not empty.

3. Create a onChange client script on TEST2 variable which will get the values both variables and check if they are similar or not.

4. If similar you can proceed further else clear the value of TEST2 variable.

 

Using this way you can verify that both the values are same.

 

Kindly mark the answer Correct or Helpful if it addresses your concern.

 

 

Regards,

 

Siddhesh

Hey Siddhesh,

 

Could you give me an example or template of what the client script should look like? 

 

Thank you,

 

VD

Hello @vishwadhatha ,

 

this is the simplest template you can use for you client script:

function onChange(control, oldValue, newValue, isLoading) {
   if (isLoading || newValue == '') {
      return;
   }
var var1 = g_form.getValue('test_1');  
var var2 = g_form.getValue('test_2');

// Check if the values are the same
if (var1 === var2) {
alert('The values are the same');
} else {
alert('The values are not the same');
g_form.clearValue('test_2');
}
}

 

SiddheshGawade_0-1705993034334.png

 

Kindly mark the answer ✔️Correct or Helpful ✔️If it addresses your concern.


Regards,

Siddhesh

 

Hey Siddhesh,

 

Thank you for the guidance, could you give me an example or template of what the client script should look like for this? 

 

Thank you,

 

VD