Required Field condition

Hello

am using asp.net maker 2025.10 , and i have a problem with required field , that is the first field is int and be as dropdownlist and when select one value should make the second field is required which is the text field , i tried many ways but there is no solution yet

i hope get some help please

thanks

For complex conidtion, use the Form_CustomValidate client script.

so how to make it if will change the value of field (X) to be (1) that make field (Y) is required??

Field (X) is (int)

Field (Y) is (nvarchar)

It should be something like:

function(fobj) {
    var $fldx = $(this).fields("FieldX");
    var $fldy = $(this).fields("FieldY");
    if ($fldx.toNumber() == 1 && !$fldy.val())
        return this.addCustomError("FieldY", "Field Y is required");
    return true;
}