Solved
File Upload Validate Extension On Button Disabled
I am trying to keep the submit button disabled if they have not selected a file and if the file is not a CSV extension.
The button disable works fine for check for no file but the file extension checking is not working and can not figure out why.
In the below code the first if is working fine but the second one it gets this error
primaryButtons: {
a!buttonWidget(
label: "Submit",
submit: true,
style: "PRIMARY",
disabled: if(
rule!APN_isEmpty(ri!csvFile_txt),
true(),
if(
find("CSV", a!fileUploadField(value: upper(document(ri!csvFile_txt, "extension")))) > 0,
false(),
true()
)
)
)
}