cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
FabioBarbosa
Helper II
Helper II

Desabilitar botao

Olá,

 

Como faço para desabilitar o botão de salvar se algum campo do formulário estiver em vazio?

 

Obrigado.

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @FabioBarbosa 

 

You should be able to resolve the script issue with this: 

 

If(
    (CountRows (DataCardValue22.Attachments) = 0));
    DisplayMode.Disabled;
    DisplayMode.Edit
)

 

Could you let me know if that works?

 

Thanks,

Sancho 

@iAm_ManCat


Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


View solution in original post

7 REPLIES 7
iAm_ManCat
Super User
Super User

Hi,

 

You can set the DisplayMode property of the Button to

If ( IsBlank ( DataCardValueXX.Text) || IsBlank(DataCardValueYY.Text), DisplayMode.Disabled, DisplayMode.Edit))

 

Then add more checks with

|| IsBlank(otherDataCard.Text)

 

Could you please give that a try and let me know how you get on,

 

Thanks!

ManCat

@iAm_ManCat


Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


Oi @iAm_ManCat ,

 

Deu certo com os campos texto e número.

 

Tenho um campo que esta criado na lista do sharepoint como Opção e também um campo anexo. Para estes dois, tentei deixar apenas || IsBlank(DataCardValueXX) <sem o .Text> mas não deu certo.

 

Como faço para que eles também façam parte da regra que se estiverem vazios, não habilita o botão?

FabioBarbosa
Helper II
Helper II

@iAm_ManCat consegui fazer para o campo de opção. Não estou conseguindo para o campo Anexo.

Hi @FabioBarbosa 

 

Glad to hear that you resolved the Option item, for the attachments you will need to count the number rows of attachment items (as it is a table of items) like this:

 

If(
   /////// Previous Code for checks ////////
   &&
   (CountRows(DataCardValue4.Attachments)=0),
   // Actions if empty

   ,
   // Submit Action

)

 

Cheers,

ManCat

@iAm_ManCat


Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


Olá @iAm_ManCat.

 

Para desabilitar o botão enviar se não tiver nenhum anexo, criei o comando abaixo na propriedade DisplayMode do Botão mas não deu certo.

 

Tentei seguir como me passou mas não consegui também.

 

If (IsBlank (DataCardValue22.Attachments);
(CountRows (DataCardValue22.Attachments) = 0)) &
DisplayMode.Disabled &
DisplayMode.Edit 

Hi @FabioBarbosa 

 

You should be able to resolve the script issue with this: 

 

If(
    (CountRows (DataCardValue22.Attachments) = 0));
    DisplayMode.Disabled;
    DisplayMode.Edit
)

 

Could you let me know if that works?

 

Thanks,

Sancho 

@iAm_ManCat


Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


Olá @iAm_ManCat ,

 

Deu certo.

 

Agradeço pelo apoio.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (3,228)