Hi Mancha,
First of all I am confirming your requirement is, when you enter data in text box and validation method will call when you click on the button right.
For this you need write code in OnClick event: In this you check values against a database and if doesn#%92t exist in the database set ‘true#%92 value for one new field (my:validate) using below code. This field data type is ‘True/False Boolean#%92 and default value is ‘false#%92.
i(validation())
{
XDocument.DOM.selectSingleNode(“/my:myFields/my:validate”).text = “true”;
}
ese
{
XDocument.DOM.selectSingleNode(“/my:myFields/my:validate”).text = “false”;
}
And in validation () method you need to write code for which type of you want to validate on that field. If will return ‘true#%92 for if the text field data does not exist in database otherwise it returns ‘false#%92. Depends on new field (my:validate) value you put the validation on that field should display red marked.
If you don#%92t want to write code for this, you need to calculate the same functionality in InfoPath and using rules you can set the true or false to new field. And do the same validation on your field using the new field value (my:validate).