Make Field Mandatory based on Date entry

D

David

Hi,

Using an IP2007 form with a date picker field, I need to make some text
fields mandatory if the date entered in the date picked field is less than
three years from the current date.

I am useless with formulas, rules and conditions in InfoPath so could
someone please guide me on how to do this?

Thanks
 
S

Sandhya

Hi,
Add the data validation to the Text fields using the below steps.
1. Select date picker in first dropdown
2. Select ‘is less than’ in second drop down.
3. Select ‘use formula’ in third dropdown and enter ‘addDays(now(), "1095")’
and click on ‘Ok’.
4. Add ‘cannot be blank’ screen tip’ and click on ‘ok’
 
S

Swathi (GGK Tech)

Hi,
Use the following steps on the text boxes which ever you want to make as
mandatory.
1.Go to text box properties.
2.Click on Data Validation button.
3.Click Add button.
4.Select the date picker field in the first drop down, is less than in
second drop down and select Use formula in the third drop down. Then you will
get a window, there place addDays(today(), 1095).
5.Then click ok. And then select and in the fourth drop down.
6.Select the date picker in the first drop down and select ‘is not blank’ in
the second drop down.
7.Click ok until all the windows get closed.

The final expression looks like
msxsl:string-compare(../my:field1, xdDate:AddDays(xdDate:Today(), 1095)) < 0
and ../my:field1 != ""
Here field1 -> date picker field.
 
R

Rajitha

Hi,
Put the below validation for text field .
(../my:DatePicker != "") and (msxsl:string-compare(../my:DatePicker,
xdDate:AddDays(xdDate:Today(), "-1095")) < 0)

Here DatePicker is the datepicker field.
Hopes this helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top