Catalog item

Deepika Ravindr
Tera Contributor
 
1 REPLY 1

Harish Bainsla
Kilo Patron
Kilo Patron

function onChange(control, oldValue, newValue, isLoading) {
if (newValue !== '') {
try {
var mobileNumber = newValue; // Assuming newValue is the mobile number field.
var name = 'Deepika'; // Replace with the name or string you want to append.

var regex = /^\d{10}$/;

if (!regex.test(mobileNumber)) {
alert(getMessage("Please enter a valid 10-digit number"));
} else {
// Concatenate the mobile number and the name
var combinedValue = mobileNumber + ' ' + name;

// Set the value of the target field (where you want to display the combined value)
g_form.setValue('target_field', combinedValue);
}
} catch (e) {
alert(e.message);
}
}
}