in

InfoPath Dev

date picker to restrict dates inputed that do not match select month

Last post 11-26-2007 08:02 AM by Clay Fox. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 11-22-2007 04:08 PM

    date picker to restrict dates inputed that do not match select month

     

    Hi

    Does anyone know how to make a date picker only allow selected dates to be inputed.  What I am looking to do is have a drop down list with all the months listed.  And when a user selects a particular month from the list, I would like the date picker to display a default begining date from that month (this I know how to do)

    And then if the user selects a date from a different month a error message to display and not to allow the user to save the form until the date is corrected.

    If anyone can help I would be much happy.

    Thank you

    James

  • 11-22-2007 11:41 PM In reply to

    Re: date picker to restrict dates inputed that do not match select month

    Put a rule on your date picker where the substring-before(datepicker,"/") does not equal the month numeric of the drop down value. Then have the action be your message or mild electric shock or whatever. :)

  • 11-24-2007 05:57 AM In reply to

    Re: date picker to restrict dates inputed that do not match select month

    Hi Clay,

    Thanks for your help again.  I was wondering if you could explain something for me.  I understand that I create  the following rule on the datepicker - substring-before(datepicker,"/") and I understand how to set an action as a message but I am not sure how I tell the date picker that it should not equal to the month numeric of the drop down value.  Would you be able to explain this to me.    

    Thank you

     James

    Filed under: , ,
  • 11-26-2007 08:02 AM In reply to

    Re: date picker to restrict dates inputed that do not match select month

    I would setup your month picker dropdown so that the value is the numeric and the label is the text.  So January would be the label and 1 the value.  That makes it easy to set or compare the month value with the user's selection. So a user selects january you would set your date picker to concat(dropdown, "/01/07") via a rule. This sets it to the first of that month and then when they click the date picker it is on that month.  Then the rule on the datepicker would validate they picked a date from that month.

    That is how I would do it.

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