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 / February 2006

Tip: Looking for answers? Try searching our database.

Conditional Submit Button

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jeffro - 14 Feb 2006 14:37 GMT
Scenario:

Have a form that a user will fill out to request access to various IT
applications. After filling out personal information name, office,
telephone # etc. there are a series of check boxes that the user can
check to request access to various applications.
On my form, I do have a submit button at the bottom of the form. When
the user clicks on the Submit button, I have rules set up that checks
which checkboxes(s) have been checked and emails are sent to the
appropriate individuals depending on which boxes are checked.

What I'm trying to figure out is how to handle either of the following:

1. The Submit button is not enabled unless one of the Check boxes is
checked   or

2. When the user clicks on the Submit button, if none of the check
boxes have been checked,  a message is displayed alerting the user to
check one of the boxes and the Submit process is cancelled and the
focus is returned to the form so the user can check one or more of the
checkboxes.
Ben Walters - 14 Feb 2006 22:35 GMT
Jeffro,
There are a couple of ways around this problem
1: Use the conditional formatting rules on the Button control to disable it
unless one of the check boxes have been ticked.

2:Using managed code you can fire the Submit event from the event handler of
your button control. The code would roughly look like this

bool CheckBoxState = false;
foreach(Checkbox on your form)
{
if(checkbox ticked)
{
CheckBoxState= true;
}
}
If (CheckBoxState )
{
e.XDocument.Submit();
}
else
{
e.XDocument.UI.Alert("Please Select a checkbox");
}

> Scenario:
>
[quoted text clipped - 17 lines]
> focus is returned to the form so the user can check one or more of the
> checkboxes.
 
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.