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

Tip: Looking for answers? Try searching our database.

dialog before submit

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
tmapola@gmail.com - 17 May 2005 17:53 GMT
Hi,

Is there any way to pop up a Yes/No dialog box before Submit so that
the form is only submitted if the user clicks "Yes"?

What I'm trying to do is have a button which asks the user if they are
sure they want to continue.  If they click "Yes", it sets some field
values and then submits the form.

Thanks!
Scott L. Heim [MSFT] - 17 May 2005 18:16 GMT
Hi,

You can do this via custom code behind your "Submit" functionality. Once
you get the response from the user, populate your data and then call the
Submit method.

Thanks,

Scott L. Heim
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights
tmapola@gmail.com - 17 May 2005 19:56 GMT
Thanks for your reply!

We tried what you suggested but it's not quite working.  We have
created a data connection for submit that submits the form to a
SharePoint form library then closes the form.  We have two buttons that
make use of this data connection.

The first button, called "Submit", has "Submit" as the action in the
button properties and it works properly (i.e. it submits then closes
the form).

The second button, called "Approve", has "Rules and Custom Code" as the
action.  When the user clicks on the "Approve" button, we would like to
set the "state" field of the form then run the submit as normal (i.e.
submit and close).  For our custom code we have:

function BTN_APPROVE::OnClick(eventObj)
{
  var clicked = XDocument.UI.Confirm("Are you sure you want to Approve
this form?", 4);
  if(clicked == 6)
  {
     var stateNode =
XDocument.DOM.selectSingleNode("/my:myFields/my:state");
     stateNode.text = "Approved";
     XDocument.Submit();
  }
}

Everything works EXCEPT it doesn't close the form.  Any suggestions?

Thanks again,
Tracy
Scott L. Heim [MSFT] - 17 May 2005 21:03 GMT
Hi Tracy,

If you want to just close the current InfoPath document, you can use the
following:

Application.XDocuments.Close(0);

However, if you want to close InfoPath entirely, use:

Application.Quit(false);

I hope this helps!

Best Regards,

Scott L. Heim
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights
Alex [MSFT] - 17 May 2005 18:30 GMT
You will need to write some custom code in order to show a "yes/no"
dialog; instead, allow me to propose a slight workaround:

- Set up a button on the form that has a "Submit" label; setup a rule on
this button to switch to another view.
- This view will be a "confirmation" view: contain some text + two
buttons, yes and no.
- Set up a rule on the yes button with two actions:
    - set some default values
    - perform a submit
- Set up a rule on the no button to go back to the data entry view

Good luck,
Alex @ Microsoft

-----Original Message-----
From: tmapola@gmail.com [mailto:tmapola@gmail.com]
Posted At: Tuesday, May 17, 2005 9:54 AM
Posted To: microsoft.public.infopath
Conversation: dialog before submit
Subject: dialog before submit

Hi,

Is there any way to pop up a Yes/No dialog box before Submit so that
the form is only submitted if the user clicks "Yes"?

What I'm trying to do is have a button which asks the user if they are
sure they want to continue.  If they click "Yes", it sets some field
values and then submits the form.

Thanks!
tmapola@gmail.com - 18 May 2005 16:42 GMT
Thanks for the help guys.  It was a big help!
 
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.