Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / April 2007

Tip: Looking for answers? Try searching our database.

Dialog Box

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Simmy - 28 Mar 2007 03:03 GMT
I have a form that when a user clicks on submit a dialog box comes up and
wants to verify the data a user entered. Right now the dialog box only has a
"ok" button which when clicked will submit the form. Is there any way to add
a "cancel" button so that the user can change data before it is submitted.
S.Y.M. Wong-A-Ton - 28 Mar 2007 10:56 GMT
I'm not sure how you've set up your form, but you can use code to show a
dialog box with the desired buttons:

XDocument.UI.Confirm("Your message", 1) will give you OK/Cancel buttons
XDocument.UI.Confirm("Your message", 3) will give you Yes/No/Cancel buttons
XDocument.UI.Confirm("Your message", 4) will give you Yes/No buttons

The Confirm method will return a value and you can then take action
depending upon which value was returned. For further information, see
http://msdn2.microsoft.com/en-us/library/bb229982.aspx
---
S.Y.M. Wong-A-Ton

> I have a form that when a user clicks on submit a dialog box comes up and
> wants to verify the data a user entered. Right now the dialog box only has a
> "ok" button which when clicked will submit the form. Is there any way to add
> a "cancel" button so that the user can change data before it is submitted.
Simmy - 17 Apr 2007 19:50 GMT
Thank you for your help. This has worked in a simple button test but I have a
more detailed question.

We are submitting to SQL with a submit button with custom rules. Our rules
perform several calculations in the form but then also bring up a standard
alert box which concatenates various fields with some fixed text, all adding
up to an informational "Are you Sure" window.  Since infopath's standard
alert popup only has an OK button, and we still need other rules to fire
after the pressing of this OK button,  we need to apply the
XDocument.UI.Confirm specs that you named, specifically to this alert. On the
other hand, we need all rules and submission to halt if we hit "cancel". We
are not avid coders but can certainly copy and paste with the best of 'em.
Can you please give us an idea of how to incorporate your teachings below
into the "Are you Sure" alert system we already have? Or perhaps propose an
alternative to our existing alert box? Thanks again for your help.

> I'm not sure how you've set up your form, but you can use code to show a
> dialog box with the desired buttons:
[quoted text clipped - 13 lines]
> > "ok" button which when clicked will submit the form. Is there any way to add
> > a "cancel" button so that the user can change data before it is submitted.
S.Y.M. Wong-A-Ton - 18 Apr 2007 07:28 GMT
Since I do not really have a very clear picture of your alert system, I
cannot really give much advice on it. In any case, I have some bad news for
you: Since rules always fire before code, you'll never be able to stop them
from within your code, so your only option will be to implement the
functionality of all the rules, which you currently have in your form, in
code to be able to use a dialog box and get control over whether certain
logic is executed or not when someone chooses to cancel an action.
---
S.Y.M. Wong-A-Ton

> Thank you for your help. This has worked in a simple button test but I have a
> more detailed question.
[quoted text clipped - 29 lines]
> > > "ok" button which when clicked will submit the form. Is there any way to add
> > > a "cancel" button so that the user can change data before it is submitted.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.