1

I have 2 Drop Downs

  1. Month
  2. Date

In Month Column dropdown I am displaying

Jan, Feb, March, April, May, June, July, August, Sep, Oct, Nov, Dec

In Date Column dropdown I am Displaying

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15....31

How can I do a Calulated Formula where in:

  • If Jan is selected in Month dropdown then Date dropdown should have 31 days.

  • If Feb is selected in Month dropdown then Date dropdown should display 28 or 29 days.

  • and so on

Can you please guide me how to achieve this in a List Calculated Column.

1

This would not be possible as a calculated column given that you want to control the users input. You may be able to do it with list level validation but that would only tell the user they had entered an incorrect Date when they tried to save the form.

jQuery is probably your best option where you can adjust the Date drop-down choices based on the selected Month.

However, it may make more sense to ask why you are taking this approach and recreating what the Date field does by default? If you want to get the Date and Month values separately then I would use calculated columns to get these from a Date column. eg

=TEXT([MyDate],"dd")
  • Hi Dave, Thanks for your reply. In my scenario i dont want to show year to the user . That is the reason why I have used the dropdown values. However in the formule mentioned below can i use created column that is =TEXT([Created],"dd")?? – sandy143 Jun 4 '13 at 12:01
  • But the year is an important part of the date formula. How do you know if Feb has 28 or 29 days if you do not know which year it is? Once you have selected a date in the New Form then you could hide the date column from users and just display the Day and Month using the calculated column approach above. – Dave Paylor Jun 4 '13 at 20:40
0

If you are allowed to use InfoPath, you can filter dropdown items by month column dropdown using rules.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.