Can anyone please tell me how can i disable button in a from if any of the input fields are empty?

Hello Avneet!

Notice that on the properties of the Button you have the Enabled property. 

You can use an expression (with the If function) enabling only if all the fields are property filled.


Hope it can help!

Cheers

Hi Avneet,

You need to have a variable that controls the enable property of the button and starts with false. Than you need to create a screen action that check if all the inputs are filled and if yes changes that variable to true and ajax refresh the button. you need to call this action in all inputs onchange.

There are other more complex solutions where you use javascript but I recommend you to start with this one.

Regards,

Marcelo 

Hi Marcelo,

i have attached my module can you please edit in that because i didnt completely get what you telling me to do.

Rui Pedro Moura wrote:

Hello Avneet!

Notice that on the properties of the Button you have the Enabled property. 

You can use an expression (with the If function) enabling only if all the fields are property filled.


Hope it can help!

Cheers

Can you please tell me the conditions for username and password not empty?


I would suggest to put this expression on Enabled property:


Form.Record.Entity.UserName <> NullIdentifier() and Form.Record.Entity.UserName <> NullIdentifier()


Notice that you have to adapt this statements to your application. (i.e. by default I called them, "Form", "Entity" and "UserName")

Solution

Hi,

Attached a solution for you.

Regards,

Marcelo

Solution

hi Marcelo,

In your solution the button is still disabled when i have entered the username and password.

An Ajax Refresh is needed, maybe.


Marcelo Ferreira wrote:

Hi,

Attached a solution for you.

Regards,

Marcelo

hi marcelo, 

its done. Thanks a lot.