[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 731
  • Last Modified:

Prevent double clicking Infopath 2010

I have click event for submit button that works just fine.
Now, I want to prevent double clicking of that button.

Please suggest what I need to write in the click event to disable the button as soon as the button is clicked for the first time.
0
me24hour
Asked:
me24hour
  • 2
  • 2
1 Solution
 
clayfoxCommented:
you just need to add a field to be a counter.
Increment it on click as well and then put a condition that click is less than 1 to execute.
0
 
me24hourAuthor Commented:
Actually, I am not very much familiar with the Infopath object model.
So, can you please tell what is the code I need to add.

        public void button_ID_Clicked(object sender, ClickedEventArgs e)
        {
            try
            {
                // My code is here.
               // ?? what I need to add here in order to disable and hide the button the button.
                }              
            }
           
            catch (Exception ex)
            {
                ex.Message.ToString();
            }
         
        }
0
 
clayfoxCommented:
I don't use code, just InfoPath rules but this should be pretty basic.
Define another number field in your main data source.
Set it to 0 by default
Put a if statement at the begining of your code that if field greater than 0 exit
else your code and at the end set field to 1
0
 
me24hourAuthor Commented:
Thanks Clayfox. But, this is not what I actually want.
I want to enable and unhide the button as soon as I enter the click event.
And, want to disable and hide the button as soon as I leave the click event.

I used
this.Enabled = false

But, it is giving some syntax error
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now