1
votes

Currently, I have a button in my form with action (generate title for the document, change some fields values, write histories...) and then SubmitForm(MyForm).

But, I have three required fields, and if they are empty, my SubmitForm generate errors. What I need, is to check these fieds before submit. I can use IfBlank, but in this case, I don't have the error named below my fields. How can I do the same check than the submitform, before to submit my forms ?

Thanks !

2
If the button will be disabled when some required fields are empty will be enough? - aozk
It could be enough, if it's possible to see the red warning "Fields should'nt be empty". It it possible ? When I submit and have these errors, if I put a number in my field, warning disapear, and if I delete the number, warning appears again. Is it possible to have this warning if my default number (0) is suppress ? - Damien MEYER

2 Answers

1
votes

DataCardValue1, DataCardValue2, DataCardValue3 - your required fields

To disable button:
Button DisplayMode : If(IsBlank(DataCardValue1.Text) || IsBlank(DataCardValue2.Text) || IsBlank(DataCardValue3.Text), DisplayMode.Disabled, DisplayMode.Edit)

To display warning when fields are empty:

DataCardValue1,2,3 Fill : If(IsBlank(DataCardValue1.Text), RGBA(220, 72, 80, 1),RGBA(255, 255, 255, 1))
DataCardValue1,2,3 HintText : If(IsBlank(DataCardValue1.Text), "field shouldn't be empty" ,"")

0
votes

You can use IsBlank for checking that is the text field is blank or not and on its true you can use Notify("Please Fill Required Fields",Warning) this will show an error message. Notify has Success and Alert notification types, Check it out.