Hello,
I have created an Identify User Screen where user enters value of 3 attributes (attribute1, attribute2 and attribute3) in order to be identified.
There is another attribute, attribute4 which is a hidden attribute on the Identify User Search Screen and it comes from a different data source.
As per the design attribute4 is the string sum of attribute1, attribute2 and attribute3.
I need to prepare a validation javascript that would validate that if the string sum of the value of attribute1, attribute2 and attribute3 which the user is entering is equals to attribute4.
I need help in the scripting part where I need to search the user on basis of the entered value by the user for attribute1, attribute2 and attribute3 and consequently evaluate the string sum against attribute4.
Please help me on the same and also, one more query, how to read the value of a hidden attribute? Use Screencontext.getFieldValue() ?
Code That I have Written (Missing the searching User Part for which I need Help):
function validate(Screencontext, errorMessage)
{
var answer1 = String(Screencontext.getFieldValue("attribute1"));
var answer2 = String(Screencontext.getFieldValue("attribute2"));
var answer3 = String(Screencontext.getFieldValue("attribute3"));
var answer4 = String(Screencontext.getFieldValue("attribute4"));
var newAnswer = answer1+answer2+answer3+answer4;
if ( newAnswer != answer4)
{
errorMessage.reference = "Error Mismatch: Attribute4"
return false;
}
}
Thanks & BR
Sandipan