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 / August 2005

Tip: Looking for answers? Try searching our database.

XdConfirmChoice question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ChrisB - 16 Aug 2005 23:01 GMT
I have the following code for a submit button that I added to my form.  I
would like to verify with the user that they are ready to submit, but I am
having trouble getting the code to work correctly based on the user response.
I always seem to get the message "You answered no" from the code. What am I
missing?

function submit_button::OnClick(eventObj)
{
   
    XdConfirmChoice = XDocument.UI.Confirm("Are you ready to submit the
invoice?",4);
   
    if (XdConfirmChoice.xdYes)
        {
            XDocument.UI.Alert("You answered yes!");
        }
    else
        {
            XDocument.UI.Alert("You answered no!");
        }
}
Anton L - 16 Aug 2005 23:14 GMT
it seems your if statement doesn't actually compare anything. try something
like

var userChoice = XDocument.UI.Confirm("Are you ready to submit the
invoice?",4);
   
    if (userChoice == XdConfirmChoice.xdYes)
        {
            XDocument.UI.Alert("You answered yes!");
        }
      else
        {
            XDocument.UI.Alert("You answered no!");
        }
}

>I have the following code for a submit button that I added to my form.  I
>would like to verify with the user that they are ready to submit, but I am
[quoted text clipped - 17 lines]
>        }
>}
ChrisB - 16 Aug 2005 23:26 GMT
Anton, when I try your example, I get error "XDConfirmChoice is undefined".  
How do I prevent that?

> it seems your if statement doesn't actually compare anything. try something
> like
[quoted text clipped - 33 lines]
> >        }
> >}
Anton L - 16 Aug 2005 23:43 GMT
Similar code worked in managed code, but why don't you just the actual
integer value instead of the enum. Lookup up the values you want here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ipsdk/html/xden
mXdConfirmChoice_HV01104062.asp


>Anton, when I try your example, I get error "XDConfirmChoice is undefined".  
>How do I prevent that?
[quoted text clipped - 4 lines]
>> >        }
>> >}
ChrisB - 17 Aug 2005 16:16 GMT
Thanks Anton, the integer value works, so I gave up on the enum.

> Similar code worked in managed code, but why don't you just the actual
> integer value instead of the enum. Lookup up the values you want here:
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ipsdk/html/xden
mXdConfirmChoice_HV01104062.asp
 
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.