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

Tip: Looking for answers? Try searching our database.

Data Validation - Check boxes and Text boxes Question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jgrisi - 21 Jun 2005 14:37 GMT
I'd like to set an error message to appear if case of the following:
A check box value is TRUE (checked off), but the adjoining textbox is left
blank.

My condition is "Checkbox" = TRUE and "Textbox" is blank, then show this
error alert, dialog box alert "Error Message"

When I publish the form, I am able to check off the box and still leave the
form blank?

Help.

Thanks.
kfrost - 21 Jun 2005 15:49 GMT
Hello,

I'm not sure I fully understand your situation, but if I understand you
correctly you don't want the checkbox to stay select if there is no text in a
test field?  I would think you would need to add code to an event such as
OnValidate for the text box.

I apologize but I don't know Infopath syntax well enough to show you an
example as to how to do it but in laymans terms,

Say you have a check box named chkCheck and a text field named txtText.

For txtText you create a validation with the following conditions:
chkCheck is equal to TRUE
txtText is blank

Select ok and in the Data Validation window, under Script, select probably
OnValidate and then Edit.  

Enter your code here that will check /my:myFields/my:txtText and if blank,
change the value of /my:myFields/my:chkCheck = FALSE

I apologize for not giving you working code but I'm just now learning myself
how to utilize objects in Infopath with code.

> I'd like to set an error message to appear if case of the following:
> A check box value is TRUE (checked off), but the adjoining textbox is left
[quoted text clipped - 9 lines]
>
> Thanks.
jgrisi - 21 Jun 2005 16:00 GMT
Thanks.

Basically, If the check box is checked and the text box is blank, I want an
error to pop up.  I should be able to do that without creating a script,
right?

> Hello,
>
[quoted text clipped - 34 lines]
> >
> > Thanks.
kfrost - 21 Jun 2005 18:28 GMT
Ok, you made me pick up my book.  I think you can.  I kind of got this to
work by creating a rule for the checkbox.

I added 2 actions to the rule.
1) Show Dialog Box Message
2) Set a field's Value

For the second, for Field you use the checkbox Field.  For the value I
inserted the following function, string("false").

That worked with a caveat.  For some reason I got the message box twice that
I needed to enter in a value for the text box.  You'll have to work that out
but it did give the popup you were looking for and then it set the checkbox
value to FALSE which means the checkbox was unchecked.

> Thanks.
>
[quoted text clipped - 40 lines]
> > >
> > > Thanks.
kfrost - 21 Jun 2005 18:31 GMT
P.S.  Instead of using false for the value mentioned below just use the
number 0.  However, for some reason I still get the dialogue box twice.

Hopefully that'll get you on the right track.

> Thanks.
>
[quoted text clipped - 40 lines]
> > >
> > > Thanks.
jgrisi - 22 Jun 2005 18:41 GMT
Thanks for all your help!

I'm actually running a demo version, testing it out before I put together a
proposal.

I'll try changing the values to 1 and 0.

I appreciate you picking up your book to help me out!

> P.S.  Instead of using false for the value mentioned below just use the
> number 0.  However, for some reason I still get the dialogue box twice.
[quoted text clipped - 45 lines]
> > > >
> > > > Thanks.
 
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.