Solved

Prevent double clicking Infopath 2010

Posted on 2011-03-25
4
716 Views
Last Modified: 2012-05-11
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
Comment
Question by:me24hour
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 28

Expert Comment

by:clayfox
ID: 35218946
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
 

Author Comment

by:me24hour
ID: 35218995
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
 
LVL 28

Accepted Solution

by:
clayfox earned 500 total points
ID: 35219075
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
 

Author Comment

by:me24hour
ID: 35219180
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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Veriface disable 2 48
Gaming Software 1 36
Read some really old .pic files??? 18 79
Software upgrade to new version on newly purchased title 7 58
This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
This article was originally published on Monitis Blog, you can check it here . If you have responsibility for software in production, I bet you’d like to know more about it. I don’t mean that you’d like an extra peek into the bowels of the sourc…
The viewer will learn how to create multiple layers to apply various filters and how to delete areas from each layer’s filter.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

742 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question