Confirmation message before form submit - InfoPath Dev
in

InfoPath Dev

Confirmation message before form submit

Last post 02-09-2006 12:22 PM by newtoinfopath. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 02-06-2006 09:18 AM

    Confirmation message before form submit

    I am new to infopath. I am designing a form where i want to include this feature- When the user fills the form and strikes the SUBMIT button, I would like to have a pop up box appearing with the following texts "Do you want to continue?" and two options for the user to select YES and NO.
    If the user selects YES, then the form should be submitted to the sharepoint. Else if the user selects NO, then the form should not be submitted.
    WE need this to have the user submit the form only once!
    I would highly appreciate any input on this! Thanks in advance.
  • 02-06-2006 12:08 PM In reply to

    Re: Confirmation message before form submit

    You may have write some code in either .NET or script to do that. Basically you would have to display a yes/no prompt and then if the user does yes, you would call submit() in code which would submit your form to SharePoint.
    Jason
    http://www.k2distillery.com/
  • 02-06-2006 09:07 PM In reply to

    Re: Confirmation message before form submit

    Add this code for your button

    string strSubmit=thisXDocument.UI.Confirm("Do you want to continue?",XdConfirmButtons.xdYesNo).ToString();
    if(strSubmit=="xdYes")
    //Write code to submit
    else
    return;
  • 02-09-2006 11:05 AM In reply to

    Re: Confirmation message before form submit

    Thanks for the quick replies.
    Abhishek, I tried the code you mentioned above, but it gives me the following error message- "; Expected at the statement - string strSubmit=thisXDocument.UI.Confirm("Do you want to continue?",XdConfirmButtons.xdYesNo).ToString();

    I have been pulling out my hair to fix this.. it must be a simple correction, but since i am new i just cant figure it out.. Could you please shed some light on this one. Appreciate any of your expert opinion/suggestions... Thanks in advance!!!
  • 02-09-2006 11:22 AM In reply to

    Re: Confirmation message before form submit

    What language are you coding in? You will probably have to modify the code snippet (which is C#.net, I think) that Abhishek provided to fit the syntax of whatever language your form is using.

    If you don't know what language your using and haven't changed anything from default, you are using JScript, and would need to modify your code like this:

    var response = XDocument.UI.Confirm( "Hello", 4 );

    if( response == 6 )
    {
    // write code to submit
    }

    This is documented in the InfoPath SDK, which is available from the link on the left side of this website.

    ---------------
    Matt Faus
    InfoPath Dev Texas
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 02-09-2006 12:22 PM In reply to

    Re: Confirmation message before form submit

    Thanks a Lot!!!! It Worked....


Page 1 of 1 (6 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.